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_target | |
| parent | b8c56fa8c30821129b0960180f528d4a1a4f9316 (diff) | |
| download | rust-2ef8af66196f7cc270a0532ea989f2fc6bc6885d.tar.gz rust-2ef8af66196f7cc270a0532ea989f2fc6bc6885d.zip | |
Adopt let else in more places
Diffstat (limited to 'compiler/rustc_target')
| -rw-r--r-- | compiler/rustc_target/src/abi/mod.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_target/src/lib.rs | 1 | 
2 files changed, 4 insertions, 6 deletions
| diff --git a/compiler/rustc_target/src/abi/mod.rs b/compiler/rustc_target/src/abi/mod.rs index 7f1fd28b30d..4ef86371298 100644 --- a/compiler/rustc_target/src/abi/mod.rs +++ b/compiler/rustc_target/src/abi/mod.rs @@ -121,12 +121,9 @@ impl TargetDataLayout { dl.pointer_align = align(a, p)?; } [s, ref a @ ..] if s.starts_with('i') => { - let bits = match s[1..].parse::<u64>() { - Ok(bits) => bits, - Err(_) => { - size(&s[1..], "i")?; // For the user error. - continue; - } + let Ok(bits) = s[1..].parse::<u64>() else { + size(&s[1..], "i")?; // For the user error. + continue; }; let a = align(a, s)?; match bits { diff --git a/compiler/rustc_target/src/lib.rs b/compiler/rustc_target/src/lib.rs index b18d17c1b7d..2919743e499 100644 --- a/compiler/rustc_target/src/lib.rs +++ b/compiler/rustc_target/src/lib.rs @@ -9,6 +9,7 @@ #![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")] #![feature(bool_to_option)] +#![feature(let_else)] #![feature(nll)] #![feature(never_type)] #![feature(associated_type_bounds)] | 
