diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-06-17 23:19:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-17 23:19:31 +0200 |
| commit | da985cb2be31ef276ec4fd1c937aa1ac927ed2e4 (patch) | |
| tree | 01cd4292de33c436f383018f0facfb9dcc98dbe7 | |
| parent | f3db63916e541ff039ac3cd7364c2d612749b61b (diff) | |
| parent | 62435f922a0b0b100f217f13047d4741c14ec1c5 (diff) | |
| download | rust-da985cb2be31ef276ec4fd1c937aa1ac927ed2e4.tar.gz rust-da985cb2be31ef276ec4fd1c937aa1ac927ed2e4.zip | |
Rollup merge of #141574 - fee1-dead-contrib:push-owzulzmzszzx, r=jhpratt
impl `Default` for `array::IntoIter` cc rust-lang/rust#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.
| -rw-r--r-- | library/core/src/array/iter.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/library/core/src/array/iter.rs b/library/core/src/array/iter.rs index 90f76d6d4c7..a59b2f05305 100644 --- a/library/core/src/array/iter.rs +++ b/library/core/src/array/iter.rs @@ -224,6 +224,13 @@ impl<T, const N: usize> IntoIter<T, N> { } } +#[stable(feature = "array_value_iter_default", since = "CURRENT_RUSTC_VERSION")] +impl<T, const N: usize> Default for IntoIter<T, N> { + fn default() -> Self { + IntoIter::empty() + } +} + #[stable(feature = "array_value_iter_impls", since = "1.40.0")] impl<T, const N: usize> Iterator for IntoIter<T, N> { type Item = T; |
