We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a422610 + a4f391d commit d8d24d4Copy full SHA for d8d24d4
library/core/src/option.rs
@@ -1007,7 +1007,7 @@ impl<T> Option<T> {
1007
{
1008
match self {
1009
Some(x) => x,
1010
- None => Default::default(),
+ None => T::default(),
1011
}
1012
1013
@@ -1615,11 +1615,7 @@ impl<T> Option<T> {
1615
where
1616
T: Default,
1617
1618
- fn default<T: Default>() -> T {
1619
- T::default()
1620
- }
1621
-
1622
- self.get_or_insert_with(default)
+ self.get_or_insert_with(T::default)
1623
1624
1625
/// Inserts a value computed from `f` into the option if it is [`None`],
0 commit comments