Apply clippy::single_match suggestion
This commit is contained in:
parent
7491468278
commit
bedbf3bacb
|
@ -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 {
|
||||
|
|
|
@ -509,9 +509,8 @@ pub mod os {
|
|||
pub unsafe fn get(&'static self, init: fn() -> T) -> Option<&'static T> {
|
||||
let ptr = self.os.get() as *mut Value<T>;
|
||||
if ptr as usize > 1 {
|
||||
match (*ptr).inner.get() {
|
||||
Some(ref value) => return Some(value),
|
||||
None => {},
|
||||
if let Some(ref value) = (*ptr).inner.get() {
|
||||
return Some(value);
|
||||
}
|
||||
}
|
||||
self.try_initialize(init)
|
||||
|
|
Loading…
Reference in a new issue