diff options
Diffstat (limited to 'compiler/rustc_serialize')
| -rw-r--r-- | compiler/rustc_serialize/src/json.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_serialize/src/lib.rs | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_serialize/src/json.rs b/compiler/rustc_serialize/src/json.rs index 6a398549241..7e08b18cf48 100644 --- a/compiler/rustc_serialize/src/json.rs +++ b/compiler/rustc_serialize/src/json.rs @@ -2306,9 +2306,8 @@ impl crate::Decoder for Decoder { } json => bad!(ExpectedError("String or Object".to_owned(), json.to_string())), }; - let idx = match names.iter().position(|n| *n == &name[..]) { - Some(idx) => idx, - None => bad!(UnknownVariantError(name)), + let Some(idx) = names.iter().position(|n| *n == &name[..]) else { + bad!(UnknownVariantError(name)); }; f(self, idx) } diff --git a/compiler/rustc_serialize/src/lib.rs b/compiler/rustc_serialize/src/lib.rs index b31fbab20ac..bd257dc6464 100644 --- a/compiler/rustc_serialize/src/lib.rs +++ b/compiler/rustc_serialize/src/lib.rs @@ -15,6 +15,7 @@ Core encoding and decoding interfaces. #![feature(min_specialization)] #![feature(core_intrinsics)] #![feature(maybe_uninit_slice)] +#![feature(let_else)] #![feature(new_uninit)] #![cfg_attr(test, feature(test))] #![allow(rustc::internal)] |
