diff options
| author | est31 <MTest31@outlook.com> | 2022-02-19 00:48:49 +0100 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-02-19 17:27:43 +0100 |
| commit | 2ef8af66196f7cc270a0532ea989f2fc6bc6885d (patch) | |
| tree | e023e65e895d79575848f47b3d00129f9c5a9f0f /compiler/rustc_errors | |
| parent | b8c56fa8c30821129b0960180f528d4a1a4f9316 (diff) | |
| download | rust-2ef8af66196f7cc270a0532ea989f2fc6bc6885d.tar.gz rust-2ef8af66196f7cc270a0532ea989f2fc6bc6885d.zip | |
Adopt let else in more places
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index f90f4d46a9a..bfed9211cec 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -1138,9 +1138,8 @@ impl EmitterWriter { } fn get_multispan_max_line_num(&mut self, msp: &MultiSpan) -> usize { - let sm = match self.sm { - Some(ref sm) => sm, - None => return 0, + let Some(ref sm) = self.sm else { + return 0; }; let mut max = 0; @@ -1590,9 +1589,8 @@ impl EmitterWriter { level: &Level, max_line_num_len: usize, ) -> io::Result<()> { - let sm = match self.sm { - Some(ref sm) => sm, - None => return Ok(()), + let Some(ref sm) = self.sm else { + return Ok(()); }; // Render the replacements for each suggestion |
