Implement Default for some alloc/core iterators
This way one can `mem::take()` them out of structs or #[derive(Default)] on structs containing them. These changes will be insta-stable.
This commit is contained in:
parent
31f858d9a5
commit
05c7330ca0
18 changed files with 243 additions and 2 deletions
|
|
@ -393,6 +393,13 @@ macro_rules! iterator {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "default_iters", since = "CURRENT_RUSTC_VERSION")]
|
||||
impl<T> Default for $name<'_, T> {
|
||||
fn default() -> Self {
|
||||
(& $( $mut_ )? []).into_iter()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue