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:
Matthias Krüger 2023-04-30 16:25:48 +02:00 committed by GitHub
commit d8d24d498f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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`],