@@ -1102,6 +1102,8 @@ trait SplitIter: DoubleEndedIterator {
1102
1102
1103
1103
/// An iterator over subslices separated by elements that match a predicate
1104
1104
/// function.
1105
+
1106
+ #[ derive( Clone ) ]
1105
1107
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1106
1108
pub struct Split < ' a , T : ' a , P > where P : FnMut ( & T ) -> bool {
1107
1109
v : & ' a [ T ] ,
@@ -1119,17 +1121,6 @@ impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for Split<'a, T, P> where P: FnMut(&T
1119
1121
}
1120
1122
}
1121
1123
1122
- // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
1123
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1124
- impl < ' a , T , P > Clone for Split < ' a , T , P > where P : Clone + FnMut ( & T ) -> bool {
1125
- fn clone ( & self ) -> Split < ' a , T , P > {
1126
- Split {
1127
- v : self . v ,
1128
- pred : self . pred . clone ( ) ,
1129
- finished : self . finished ,
1130
- }
1131
- }
1132
- }
1133
1124
1134
1125
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1135
1126
impl < ' a , T , P > Iterator for Split < ' a , T , P > where P : FnMut ( & T ) -> bool {
@@ -1398,24 +1389,13 @@ forward_iterator! { SplitNMut: T, &'a mut [T] }
1398
1389
forward_iterator ! { RSplitNMut : T , & ' a mut [ T ] }
1399
1390
1400
1391
/// An iterator over overlapping subslices of length `size`.
1401
- #[ derive( Debug ) ]
1392
+ #[ derive( Clone , Debug ) ]
1402
1393
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1403
1394
pub struct Windows < ' a , T : ' a > {
1404
1395
v : & ' a [ T ] ,
1405
1396
size : usize
1406
1397
}
1407
1398
1408
- // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
1409
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1410
- impl < ' a , T > Clone for Windows < ' a , T > {
1411
- fn clone ( & self ) -> Windows < ' a , T > {
1412
- Windows {
1413
- v : self . v ,
1414
- size : self . size ,
1415
- }
1416
- }
1417
- }
1418
-
1419
1399
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1420
1400
impl < ' a , T > Iterator for Windows < ' a , T > {
1421
1401
type Item = & ' a [ T ] ;
@@ -1492,24 +1472,13 @@ impl<'a, T> ExactSizeIterator for Windows<'a, T> {}
1492
1472
///
1493
1473
/// When the slice len is not evenly divided by the chunk size, the last slice
1494
1474
/// of the iteration will be the remainder.
1495
- #[ derive( Debug ) ]
1475
+ #[ derive( Clone , Debug ) ]
1496
1476
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1497
1477
pub struct Chunks < ' a , T : ' a > {
1498
1478
v : & ' a [ T ] ,
1499
1479
size : usize
1500
1480
}
1501
1481
1502
- // FIXME(#19839) Remove in favor of `#[derive(Clone)]`
1503
- #[ stable( feature = "rust1" , since = "1.0.0" ) ]
1504
- impl < ' a , T > Clone for Chunks < ' a , T > {
1505
- fn clone ( & self ) -> Chunks < ' a , T > {
1506
- Chunks {
1507
- v : self . v ,
1508
- size : self . size ,
1509
- }
1510
- }
1511
- }
1512
-
1513
1482
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1514
1483
impl < ' a , T > Iterator for Chunks < ' a , T > {
1515
1484
type Item = & ' a [ T ] ;
0 commit comments