Adopt let else in more places
This commit is contained in:
parent
b8c56fa8c3
commit
2ef8af6619
132 changed files with 539 additions and 881 deletions
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue