-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messages
Description
Example (playground: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=f64cf36f94d0d7480c40454b89ffc06e)
#![warn(clippy::checked_conversions)]
pub fn foo(value: i64) -> Option<u32> {
let _ = value <= (u32::max_value() as i64) && value >= 0;
//^WARN: Checked cast can be simplified.
let _ = value <= (u32::MAX as i64) && value >= 0; // This should also be warned but it doesn't
Some(42)
}
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesCategory: Enhancement of lints, like adding more cases or adding help messages