diff options
| author | Caio <c410.f3r@gmail.com> | 2022-03-01 07:43:12 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2022-03-01 07:43:12 -0300 |
| commit | 7aa5ea9a4a10a657dbfa58c12a11aa2cd0b5bc32 (patch) | |
| tree | a16ff2183eeabf950eb3ac769ad98187edc08466 /compiler/rustc_mir_transform/src/instcombine.rs | |
| parent | 6e5a6ffb14fc47051b0a23410c681ad6e4af045f (diff) | |
| download | rust-7aa5ea9a4a10a657dbfa58c12a11aa2cd0b5bc32.tar.gz rust-7aa5ea9a4a10a657dbfa58c12a11aa2cd0b5bc32.zip | |
7 - Make more use of `let_chains`
Continuation of #94376. cc #53667
Diffstat (limited to 'compiler/rustc_mir_transform/src/instcombine.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/instcombine.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_mir_transform/src/instcombine.rs b/compiler/rustc_mir_transform/src/instcombine.rs index 792ac68671e..385fcc43496 100644 --- a/compiler/rustc_mir_transform/src/instcombine.rs +++ b/compiler/rustc_mir_transform/src/instcombine.rs @@ -77,10 +77,8 @@ impl<'tcx> InstCombineContext<'tcx, '_> { _ => None, }; - if let Some(new) = new { - if self.should_combine(source_info, rvalue) { - *rvalue = new; - } + if let Some(new) = new && self.should_combine(source_info, rvalue) { + *rvalue = new; } } |
