diff options
| author | Mateusz Mikuła <matti@marinelayer.io> | 2019-09-05 14:08:06 +0200 |
|---|---|---|
| committer | Mateusz Mikuła <mati865@gmail.com> | 2019-10-22 19:23:10 +0200 |
| commit | bedbf3bacbff36a477dcf28523cbf6cab67e9e0a (patch) | |
| tree | b4f62607d9291f87d602c29e994eac6ea41040a0 /src/libcore/option.rs | |
| parent | 749146827865dfe1f62ce757795415414bb75a15 (diff) | |
| download | rust-bedbf3bacbff36a477dcf28523cbf6cab67e9e0a.tar.gz rust-bedbf3bacbff36a477dcf28523cbf6cab67e9e0a.zip | |
Apply clippy::single_match suggestion
Diffstat (limited to 'src/libcore/option.rs')
| -rw-r--r-- | src/libcore/option.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 9eb29eae7f7..89f2d7ab29c 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -837,9 +837,8 @@ impl<T> Option<T> { #[inline] #[stable(feature = "option_entry", since = "1.20.0")] pub fn get_or_insert_with<F: FnOnce() -> T>(&mut self, f: F) -> &mut T { - match *self { - None => *self = Some(f()), - _ => (), + if let None = *self { + *self = Some(f()); } match *self { |
