Skip to content

fix: resolve clippy question_mark errors in body.rs - #13

Merged
offskip-dave merged 1 commit into
offskip-dave:mainfrom
shanesmithdev:fix/clippy-question-mark
Nov 21, 2026
Merged

offskip-dave merged 1 commit into
offskip-dave:mainfrom
shanesmithdev:fix/clippy-question-mark

Conversation

@shanesmithdev

Copy link
Copy Markdown
Collaborator

CI has failed on main since 6370123. Clippy's question_mark lint (on stable since Rust 1.100) flags four let ... else { return None; } blocks in crates/devnull/src/body.rs, and -D warnings makes them errors. Clippy fails, so the Test step never runs, on both the Ubuntu and macOS jobs.

Fix

Rewrites the four blocks in take_explicit_color and take_bare_color with ?, as Clippy suggests. Each returns None in the same cases as before, so behaviour is unchanged.

Tests

Run in a Debian trixie container with Rust 1.100 and the same GTK packages as CI:

  • cargo fmt --all -- --check: passed.
  • cargo clippy --locked --workspace --all-targets -- -D warnings: passed (it failed with these four errors before).
  • cargo test --locked --workspace: all passed.

Screenshots

  • No visible change

Copilot AI balanced review requested due to automatic review settings November 21, 2026 09:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The review evidence indicates this is a limited refactor in a single file that replaces repetitive Option unwrapping with ? to satisfy Clippy’s question_mark lint while preserving the existing None return behavior, with no outstanding issues noted.

No open issues 🎉

What changed in this PR

Resolves CI failures from Clippy’s question_mark lint (with -D warnings) by refactoring Option-based early returns in color-parsing helpers to use ? without changing behavior.

Changes:

  • Rewrote four let ... else { return None; } patterns to ? in take_explicit_color and take_bare_color.
  • Preserved the same None return conditions while restoring Clippy compliance on stable Rust.
File Description
crates/​devnull/​src/​body.rs Replaces four let-else Option unwrapping blocks with ? in color parsing helpers to satisfy Clippy’s question_mark lint while keeping behavior unchanged.

Review effort: Balanced
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

@offskip-dave
offskip-dave merged commit 3179b70 into offskip-dave:main Nov 21, 2026
2 checks passed
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.

3 participants