mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 23:24:24 +00:00
the power of if let chain compels you
This commit is contained in:
parent
aecdb921ae
commit
4d7d66462f
1 changed files with 2 additions and 1 deletions
|
@ -116,8 +116,9 @@ impl<'tcx> ClampSuggestion<'tcx> {
|
|||
}
|
||||
if let Some(max) = constant(cx, cx.typeck_results(), self.params.max)
|
||||
&& let Some(min) = constant(cx, cx.typeck_results(), self.params.min)
|
||||
&& let Some(ord) = Constant::partial_cmp(cx.tcx, max_type, &min, &max)
|
||||
{
|
||||
Constant::partial_cmp(cx.tcx, max_type, &min, &max).is_some_and(|o| o != Ordering::Greater)
|
||||
ord != Ordering::Greater
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue