chore: satisfy nightly clippy::question-mark#131
Merged
Conversation
CI runs `cargo clippy --workspace --all-targets -- -D warnings` on nightly Rust (1.97.0-nightly at writing), which enables `clippy::question-mark`. Three pre-existing sites in `spar-hir-def`, `spar-render`, and `spar-cli` triggered it — each an `if let Some / else return None` pattern that clippy wants rewritten with `?`. No behavior change; nightly clippy now clean, 2,443 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Adds three focused unit tests for the LSP swap-connection quick-fix: the unidirectional `->` path, the bidirectional `<->` path (the new `?` branch introduced in the clippy::question-mark rewrite), and the no-arrow fallback that returns None. Raises patch coverage past the codecov/patch gate. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c68f1b3 to
d6b691c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Unblocks CI: nightly clippy (what the CI workflow uses) has
clippy::question-markwarn-by-default, which-D warningspromotes to an error. Three pre-existing sites fail:crates/spar-hir-def/src/item_tree/lower.rs:1979(range-property lowering)crates/spar-render/src/lib.rs:169(ancestor-walk in render hierarchy)crates/spar-cli/src/lsp.rs:1902(connection-line arrow matching)Each was an
if let Some / else return Nonepattern. Rewritten with?per clippy's own suggestion. No behavior change.Why this is its own PR
#130 is blocked on CI being green. Main is also red (these lints are pre-existing), so rebasing #130 wouldn't help. Landing this first lets #130 merge on green CI as originally intended.
Test plan
cargo test --workspace— 2,443 pass, 0 failrustup run nightly cargo clippy --workspace --all-targets -- -D warnings— cleancargo fmt --check— clean🤖 Generated with Claude Code