Skip to content

Commit 5a8aae5

Browse files
committed
Add default keyword
1 parent e55034b commit 5a8aae5

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/libcore/iter/traits/iterator.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2703,16 +2703,15 @@ fn select_fold1<I, F>(mut it: I, mut f: F) -> Option<I::Item>
27032703
#[stable(feature = "rust1", since = "1.0.0")]
27042704
impl<I: Iterator + ?Sized> Iterator for &mut I {
27052705
type Item = I::Item;
2706-
fn next(&mut self) -> Option<I::Item> { (**self).next() }
2707-
fn size_hint(&self) -> (usize, Option<usize>) { (**self).size_hint() }
2708-
fn nth(&mut self, n: usize) -> Option<Self::Item> {
2706+
default fn next(&mut self) -> Option<I::Item> { (**self).next() }
2707+
default fn size_hint(&self) -> (usize, Option<usize>) { (**self).size_hint() }
2708+
default fn nth(&mut self, n: usize) -> Option<Self::Item> {
27092709
(**self).nth(n)
27102710
}
27112711
}
27122712

27132713
#[stable(feature = "rust1", since = "1.0.0")]
2714-
impl<I: Iterator> Iterator for &mut I {
2715-
type Item = I::Item;
2714+
impl<I: Iterator + Sized> Iterator for &mut I {
27162715
fn next(&mut self) -> Option<I::Item> { (**self).next() }
27172716
fn size_hint(&self) -> (usize, Option<usize>) { (**self).size_hint() }
27182717
fn nth(&mut self, n: usize) -> Option<Self::Item> {

0 commit comments

Comments
 (0)