- Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestionsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy
Description
Description
Running clippy on this file, I get the following suggestion:
warning: unnecessary `if let` since only the `Ok` variant of the iterator element is used --> bin.rs:503:5 | 503 | / for arg in ArgSplitFlagValue::new( 504 | | env::args().skip(3), // skip the program name, "miri" and "run" / "test" 505 | | config_flag, 506 | | ) { ... | 509 | | } 510 | | } | |_____^ | = note: `#[warn(clippy::manual_flatten)]` on by default help: ...and remove the `if let` statement in the for loop --> bin.rs:507:9 | 507 | / if let Ok(config) = arg { 508 | | cmd.arg(config_flag).arg(config); 509 | | } | |_________^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_flatten help: try | 503 ~ for arg in ArgSplitFlagValue::new( 504 + env::args().skip(3), // skip the program name, "miri" and "run" / "test" 505 + config_flag, 506 ~ ).flatten() { |
The two help
seem to be in the wrong order. At least, it seems to start a sentence with ..and
, which is rather confusing. ;) It took me a while to parse this lint.
Version
rustc 1.63.0-nightly (c7b0452ec 2022-06-04) binary: rustc commit-hash: c7b0452ece11bf714f7cf2003747231931504d59 commit-date: 2022-06-04 host: x86_64-unknown-linux-gnu release: 1.63.0-nightly LLVM version: 14.0.5
Additional Labels
No response
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestionsgood first issueThese issues are a good way to get started with ClippyThese issues are a good way to get started with Clippy