Rollup merge of #111000 - JohnBobbo96:core_option_unneeded_function, r=jyn514
Remove unneeded function call in `core::option`. r? `@jyn514`
This commit is contained in:
commit
d8d24d498f
@ -1007,7 +1007,7 @@ pub fn unwrap_or_default(self) -> T
|
||||
{
|
||||
match self {
|
||||
Some(x) => x,
|
||||
None => Default::default(),
|
||||
None => T::default(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -1615,11 +1615,7 @@ pub fn get_or_insert_default(&mut self) -> &mut T
|
||||
where
|
||||
T: Default,
|
||||
{
|
||||
fn default<T: Default>() -> T {
|
||||
T::default()
|
||||
}
|
||||
|
||||
self.get_or_insert_with(default)
|
||||
self.get_or_insert_with(T::default)
|
||||
}
|
||||
|
||||
/// Inserts a value computed from `f` into the option if it is [`None`],
|
||||
|
Loading…
Reference in New Issue
Block a user