@@ -82,6 +82,7 @@ unsafe impl<T: Sync> Sync for Iter<'_, T> {}
82
82
unsafe impl < T : Sync > Send for Iter < ' _ , T > { }
83
83
84
84
impl < ' a , T > Iter < ' a , T > {
85
+ #[ inline]
85
86
pub ( super ) fn new ( slice : & ' a [ T ] ) -> Self {
86
87
let ptr = slice. as_ptr ( ) ;
87
88
// SAFETY: Similar to `IterMut::new`.
@@ -200,6 +201,7 @@ unsafe impl<T: Sync> Sync for IterMut<'_, T> {}
200
201
unsafe impl < T : Send > Send for IterMut < ' _ , T > { }
201
202
202
203
impl < ' a , T > IterMut < ' a , T > {
204
+ #[ inline]
203
205
pub ( super ) fn new ( slice : & ' a mut [ T ] ) -> Self {
204
206
let ptr = slice. as_mut_ptr ( ) ;
205
207
// SAFETY: There are several things here:
@@ -330,6 +332,7 @@ where
330
332
}
331
333
332
334
impl < ' a , T : ' a , P : FnMut ( & T ) -> bool > Split < ' a , T , P > {
335
+ #[ inline]
333
336
pub ( super ) fn new ( slice : & ' a [ T ] , pred : P ) -> Self {
334
337
Self { v : slice, pred, finished : false }
335
338
}
@@ -974,6 +977,7 @@ where
974
977
}
975
978
976
979
impl < ' a , T : ' a , P : FnMut ( & T ) -> bool > SplitN < ' a , T , P > {
980
+ #[ inline]
977
981
pub ( super ) fn new ( s : Split < ' a , T , P > , n : usize ) -> Self {
978
982
Self { inner : GenericSplitN { iter : s, count : n } }
979
983
}
@@ -1006,6 +1010,7 @@ where
1006
1010
}
1007
1011
1008
1012
impl < ' a , T : ' a , P : FnMut ( & T ) -> bool > RSplitN < ' a , T , P > {
1013
+ #[ inline]
1009
1014
pub ( super ) fn new ( s : RSplit < ' a , T , P > , n : usize ) -> Self {
1010
1015
Self { inner : GenericSplitN { iter : s, count : n } }
1011
1016
}
@@ -1037,6 +1042,7 @@ where
1037
1042
}
1038
1043
1039
1044
impl < ' a , T : ' a , P : FnMut ( & T ) -> bool > SplitNMut < ' a , T , P > {
1045
+ #[ inline]
1040
1046
pub ( super ) fn new ( s : SplitMut < ' a , T , P > , n : usize ) -> Self {
1041
1047
Self { inner : GenericSplitN { iter : s, count : n } }
1042
1048
}
@@ -1069,6 +1075,7 @@ where
1069
1075
}
1070
1076
1071
1077
impl < ' a , T : ' a , P : FnMut ( & T ) -> bool > RSplitNMut < ' a , T , P > {
1078
+ #[ inline]
1072
1079
pub ( super ) fn new ( s : RSplitMut < ' a , T , P > , n : usize ) -> Self {
1073
1080
Self { inner : GenericSplitN { iter : s, count : n } }
1074
1081
}
@@ -1103,6 +1110,7 @@ pub struct Windows<'a, T: 'a> {
1103
1110
}
1104
1111
1105
1112
impl < ' a , T : ' a > Windows < ' a , T > {
1113
+ #[ inline]
1106
1114
pub ( super ) fn new ( slice : & ' a [ T ] , size : usize ) -> Self {
1107
1115
Self { v : slice, size }
1108
1116
}
@@ -1241,6 +1249,7 @@ pub struct Chunks<'a, T: 'a> {
1241
1249
}
1242
1250
1243
1251
impl < ' a , T : ' a > Chunks < ' a , T > {
1252
+ #[ inline]
1244
1253
pub ( super ) fn new ( slice : & ' a [ T ] , size : usize ) -> Self {
1245
1254
Self { v : slice, chunk_size : size }
1246
1255
}
@@ -1401,6 +1410,7 @@ pub struct ChunksMut<'a, T: 'a> {
1401
1410
}
1402
1411
1403
1412
impl < ' a , T : ' a > ChunksMut < ' a , T > {
1413
+ #[ inline]
1404
1414
pub ( super ) fn new ( slice : & ' a mut [ T ] , size : usize ) -> Self {
1405
1415
Self { v : slice, chunk_size : size }
1406
1416
}
@@ -1561,6 +1571,7 @@ pub struct ChunksExact<'a, T: 'a> {
1561
1571
}
1562
1572
1563
1573
impl < ' a , T > ChunksExact < ' a , T > {
1574
+ #[ inline]
1564
1575
pub ( super ) fn new ( slice : & ' a [ T ] , chunk_size : usize ) -> Self {
1565
1576
let rem = slice. len ( ) % chunk_size;
1566
1577
let fst_len = slice. len ( ) - rem;
@@ -1709,6 +1720,7 @@ pub struct ChunksExactMut<'a, T: 'a> {
1709
1720
}
1710
1721
1711
1722
impl < ' a , T > ChunksExactMut < ' a , T > {
1723
+ #[ inline]
1712
1724
pub ( super ) fn new ( slice : & ' a mut [ T ] , chunk_size : usize ) -> Self {
1713
1725
let rem = slice. len ( ) % chunk_size;
1714
1726
let fst_len = slice. len ( ) - rem;
@@ -1849,6 +1861,7 @@ pub struct ArrayWindows<'a, T: 'a, const N: usize> {
1849
1861
}
1850
1862
1851
1863
impl < ' a , T : ' a , const N : usize > ArrayWindows < ' a , T , N > {
1864
+ #[ inline]
1852
1865
pub ( super ) fn new ( slice : & ' a [ T ] ) -> Self {
1853
1866
let num_windows = slice. len ( ) . saturating_sub ( N - 1 ) ;
1854
1867
Self { slice_head : slice. as_ptr ( ) , num : num_windows, marker : PhantomData }
@@ -1960,6 +1973,7 @@ pub struct ArrayChunks<'a, T: 'a, const N: usize> {
1960
1973
}
1961
1974
1962
1975
impl < ' a , T , const N : usize > ArrayChunks < ' a , T , N > {
1976
+ #[ inline]
1963
1977
pub ( super ) fn new ( slice : & ' a [ T ] ) -> Self {
1964
1978
let len = slice. len ( ) / N ;
1965
1979
let ( fst, snd) = slice. split_at ( len * N ) ;
@@ -2077,6 +2091,7 @@ pub struct ArrayChunksMut<'a, T: 'a, const N: usize> {
2077
2091
}
2078
2092
2079
2093
impl < ' a , T , const N : usize > ArrayChunksMut < ' a , T , N > {
2094
+ #[ inline]
2080
2095
pub ( super ) fn new ( slice : & ' a mut [ T ] ) -> Self {
2081
2096
let len = slice. len ( ) / N ;
2082
2097
let ( fst, snd) = slice. split_at_mut ( len * N ) ;
@@ -2185,6 +2200,7 @@ pub struct RChunks<'a, T: 'a> {
2185
2200
}
2186
2201
2187
2202
impl < ' a , T : ' a > RChunks < ' a , T > {
2203
+ #[ inline]
2188
2204
pub ( super ) fn new ( slice : & ' a [ T ] , size : usize ) -> Self {
2189
2205
Self { v : slice, chunk_size : size }
2190
2206
}
@@ -2341,6 +2357,7 @@ pub struct RChunksMut<'a, T: 'a> {
2341
2357
}
2342
2358
2343
2359
impl < ' a , T : ' a > RChunksMut < ' a , T > {
2360
+ #[ inline]
2344
2361
pub ( super ) fn new ( slice : & ' a mut [ T ] , size : usize ) -> Self {
2345
2362
Self { v : slice, chunk_size : size }
2346
2363
}
@@ -2498,6 +2515,7 @@ pub struct RChunksExact<'a, T: 'a> {
2498
2515
}
2499
2516
2500
2517
impl < ' a , T > RChunksExact < ' a , T > {
2518
+ #[ inline]
2501
2519
pub ( super ) fn new ( slice : & ' a [ T ] , chunk_size : usize ) -> Self {
2502
2520
let rem = slice. len ( ) % chunk_size;
2503
2521
// SAFETY: 0 <= rem <= slice.len() by construction above
@@ -2650,6 +2668,7 @@ pub struct RChunksExactMut<'a, T: 'a> {
2650
2668
}
2651
2669
2652
2670
impl < ' a , T > RChunksExactMut < ' a , T > {
2671
+ #[ inline]
2653
2672
pub ( super ) fn new ( slice : & ' a mut [ T ] , chunk_size : usize ) -> Self {
2654
2673
let rem = slice. len ( ) % chunk_size;
2655
2674
// SAFETY: 0 <= rem <= slice.len() by construction above
0 commit comments