Skip to content

Commit da985cb

Browse files
authored
Rollup merge of #141574 - fee1-dead-contrib:push-owzulzmzszzx, r=jhpratt
impl `Default` for `array::IntoIter` cc #91583 my personal use of this feature comes from https://github.com/fee1-dead/w/blob/092db5df631ea515b688bae99c7f02eef12d7221/src/cont.rs#L154-L170 insta-stable, but I feel like this is small enough to _not_ require an ACP (but a FCP per https://forge.rust-lang.org/libs/maintaining-std.html#when-theres-new-trait-impls)? feel free to correct me if I am wrong.
2 parents f3db639 + 62435f9 commit da985cb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

library/core/src/array/iter.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,13 @@ impl<T, const N: usize> IntoIter<T, N> {
224224
}
225225
}
226226

227+
#[stable(feature = "array_value_iter_default", since = "CURRENT_RUSTC_VERSION")]
228+
impl<T, const N: usize> Default for IntoIter<T, N> {
229+
fn default() -> Self {
230+
IntoIter::empty()
231+
}
232+
}
233+
227234
#[stable(feature = "array_value_iter_impls", since = "1.40.0")]
228235
impl<T, const N: usize> Iterator for IntoIter<T, N> {
229236
type Item = T;

0 commit comments

Comments
 (0)