Manually impl Clone for ArrayWindows
This implementation doesn't need the derived `T: Clone`.
(cherry picked from commit 90521553e6)
This commit is contained in:
parent
f5ccb92483
commit
90e99bdd32
1 changed files with 9 additions and 1 deletions
|
|
@ -2175,7 +2175,7 @@ unsafe impl<T> Sync for ChunksExactMut<'_, T> where T: Sync {}
|
|||
///
|
||||
/// [`array_windows`]: slice::array_windows
|
||||
/// [slices]: slice
|
||||
#[derive(Debug, Clone)]
|
||||
#[derive(Debug)]
|
||||
#[stable(feature = "array_windows", since = "1.94.0")]
|
||||
#[must_use = "iterators are lazy and do nothing unless consumed"]
|
||||
pub struct ArrayWindows<'a, T: 'a, const N: usize> {
|
||||
|
|
@ -2189,6 +2189,14 @@ impl<'a, T: 'a, const N: usize> ArrayWindows<'a, T, N> {
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME(#26925) Remove in favor of `#[derive(Clone)]`
|
||||
#[stable(feature = "array_windows", since = "1.94.0")]
|
||||
impl<T, const N: usize> Clone for ArrayWindows<'_, T, N> {
|
||||
fn clone(&self) -> Self {
|
||||
Self { v: self.v }
|
||||
}
|
||||
}
|
||||
|
||||
#[stable(feature = "array_windows", since = "1.94.0")]
|
||||
impl<'a, T, const N: usize> Iterator for ArrayWindows<'a, T, N> {
|
||||
type Item = &'a [T; N];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue