Fix clippy unnecessary_unwrap warnings and rustfmt formatting - #481
Merged
Conversation
Co-authored-by: cantino <83835+cantino@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix unnecessary unwrap warnings in code
Fix clippy Feb 23, 2026
unnecessary_unwrap warnings
Co-authored-by: cantino <83835+cantino@users.noreply.github.com>
Copilot
AI
changed the title
Fix clippy
Fix clippy Feb 25, 2026
unnecessary_unwrap warningsunnecessary_unwrap warnings and rustfmt formatting
cantino
marked this pull request as ready for review
February 25, 2026 00:22
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.
Three instances of the
is_some()+.unwrap()anti-pattern were triggeringclippy::unnecessary_unwrap. A follow-upcargo fmtfailure was also introduced by the refactor.src/interface.rs:command.last_run.is_some()+.unwrap()→if let Some(last_run) = command.last_run; collapse.signed_duration_since(...)per rustfmtsrc/stats_generator.rs:settings.stats_only_dir.is_some()+.as_ref().unwrap()→if let Some(stats_only_dir) = &settings.stats_only_dirsrc/main.rs:settings.append_to_histfile.is_some()+.as_ref().unwrap()→if let Some(append_to_histfile) = &settings.append_to_histfile💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.