Skip to content

Commit 19b500b

Browse files
committed
Auto merge of rust-lang#111017 - matthiaskrgr:rollup-yy9updi, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#110118 (download-rustc: Give a better error message if artifacts can't be dowloaded) - rust-lang#110631 (rustdoc: catch and don't blow up on impl Trait cycles) - rust-lang#110732 (Make ConstProp some tests unit.) - rust-lang#110996 (bootstrap: Fix compile error: unused-mut) - rust-lang#110999 (Output some bootstrap messages on stderr) - rust-lang#111000 (Remove unneeded function call in `core::option`.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2 parents 164ee62 + 5ff603f commit 19b500b

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

core/src/option.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,7 @@ impl<T> Option<T> {
10071007
{
10081008
match self {
10091009
Some(x) => x,
1010-
None => Default::default(),
1010+
None => T::default(),
10111011
}
10121012
}
10131013

@@ -1615,11 +1615,7 @@ impl<T> Option<T> {
16151615
where
16161616
T: Default,
16171617
{
1618-
fn default<T: Default>() -> T {
1619-
T::default()
1620-
}
1621-
1622-
self.get_or_insert_with(default)
1618+
self.get_or_insert_with(T::default)
16231619
}
16241620

16251621
/// Inserts a value computed from `f` into the option if it is [`None`],

0 commit comments

Comments
 (0)