Skip to content

Make cargo clippy pass with -D warnings and run it in CI - #117

Merged
m4rocks merged 1 commit into
mainfrom
clippy-clean
Nov 17, 2026
Merged

m4rocks merged 1 commit into
mainfrom
clippy-clean

Conversation

@m4rocks

@m4rocks m4rocks commented Nov 17, 2026

Copy link
Copy Markdown
Owner

Summary

cargo clippy -D warnings failed with seven warnings, so CI couldn't run it. This fixes them and adds just lint to CI on Windows, macOS and Linux.

  • editor/keys.rs: two needless borrows of the clipboard text.
  • editor/pairs.rs: chars().next() != Some(c) becomes starts_with(c).
  • editor/display.rs: the test-only relayout_with_width moves into the test module.
  • files.rs tests: std::slice::from_ref instead of a clone, and a one-element loop unrolled.
  • editor/highlight.rs: the closure clippy calls redundant is needed, because passing injected bare ties its result to the highlighter's lifetime and doesn't compile. The lint is allowed on that one line, with the reason.

Evidence

just lint passes locally on Windows. cargo test: 494 passed, 0 failed.

Risk

CI uses stable Rust, so a new clippy release can add warnings and fail CI until they're fixed. Revert this commit to undo it.

Closes #100

Fixes the seven warnings left: a needless borrow twice, a manual starts_with, test helpers after the test module, a clone to make a slice, and a loop over one element. The closure clippy calls redundant in highlight.rs is needed for a lifetime, so that lint is allowed on that line with the reason.

CI runs `just lint` on all three platforms, so warnings can't come back unnoticed.

Closes #100
@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
claudiu Ready Ready Preview Nov 17, 2026 9:48am UTC

@m4rocks
m4rocks merged commit aca562c into main Nov 17, 2026
5 checks passed
@m4rocks
m4rocks deleted the clippy-clean branch November 24, 2026 22:38

This branch was successfully deployed

1 active deployment
Preview — f8f42197 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make cargo clippy pass with -D warnings

1 participant