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 @@ impl<T> Option<T> {
|
|||||||
{
|
{
|
||||||
match self {
|
match self {
|
||||||
Some(x) => x,
|
Some(x) => x,
|
||||||
None => Default::default(),
|
None => T::default(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1615,11 +1615,7 @@ impl<T> Option<T> {
|
|||||||
where
|
where
|
||||||
T: Default,
|
T: Default,
|
||||||
{
|
{
|
||||||
fn default<T: Default>() -> T {
|
self.get_or_insert_with(T::default)
|
||||||
T::default()
|
|
||||||
}
|
|
||||||
|
|
||||||
self.get_or_insert_with(default)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Inserts a value computed from `f` into the option if it is [`None`],
|
/// Inserts a value computed from `f` into the option if it is [`None`],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user