-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
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
Description
Given (playground):
fn f1() {
match 1usize.checked_sub(1) {
Some(v) => v,
None => 0,
};
}
clippy suggests 1usize.checked_sub(1).unwrap_or_default();
, but I think it should suggest 1usize.saturating_sub(1);
instead for both of those.
Version
Additional Labels
No response
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