@@ -1156,11 +1156,11 @@ impl<T: TrustedStep> RangeInclusiveIteratorImpl for ops::RangeInclusive<T> {
1156
1156
let is_iterating = self . start < self . end ;
1157
1157
Some ( if is_iterating {
1158
1158
// SAFETY: just checked precondition
1159
- let n = unsafe { Step :: forward_unchecked ( self . start . clone ( ) , 1 ) } ;
1159
+ let n = unsafe { Step :: forward_unchecked ( self . start , 1 ) } ;
1160
1160
mem:: replace ( & mut self . start , n)
1161
1161
} else {
1162
1162
self . exhausted = true ;
1163
- self . start . clone ( )
1163
+ self . start
1164
1164
} )
1165
1165
}
1166
1166
@@ -1179,15 +1179,15 @@ impl<T: TrustedStep> RangeInclusiveIteratorImpl for ops::RangeInclusive<T> {
1179
1179
1180
1180
while self . start < self . end {
1181
1181
// SAFETY: just checked precondition
1182
- let n = unsafe { Step :: forward_unchecked ( self . start . clone ( ) , 1 ) } ;
1182
+ let n = unsafe { Step :: forward_unchecked ( self . start , 1 ) } ;
1183
1183
let n = mem:: replace ( & mut self . start , n) ;
1184
1184
accum = f ( accum, n) ?;
1185
1185
}
1186
1186
1187
1187
self . exhausted = true ;
1188
1188
1189
1189
if self . start == self . end {
1190
- accum = f ( accum, self . start . clone ( ) ) ?;
1190
+ accum = f ( accum, self . start ) ?;
1191
1191
}
1192
1192
1193
1193
try { accum }
@@ -1201,11 +1201,11 @@ impl<T: TrustedStep> RangeInclusiveIteratorImpl for ops::RangeInclusive<T> {
1201
1201
let is_iterating = self . start < self . end ;
1202
1202
Some ( if is_iterating {
1203
1203
// SAFETY: just checked precondition
1204
- let n = unsafe { Step :: backward_unchecked ( self . end . clone ( ) , 1 ) } ;
1204
+ let n = unsafe { Step :: backward_unchecked ( self . end , 1 ) } ;
1205
1205
mem:: replace ( & mut self . end , n)
1206
1206
} else {
1207
1207
self . exhausted = true ;
1208
- self . end . clone ( )
1208
+ self . end
1209
1209
} )
1210
1210
}
1211
1211
@@ -1224,15 +1224,15 @@ impl<T: TrustedStep> RangeInclusiveIteratorImpl for ops::RangeInclusive<T> {
1224
1224
1225
1225
while self . start < self . end {
1226
1226
// SAFETY: just checked precondition
1227
- let n = unsafe { Step :: backward_unchecked ( self . end . clone ( ) , 1 ) } ;
1227
+ let n = unsafe { Step :: backward_unchecked ( self . end , 1 ) } ;
1228
1228
let n = mem:: replace ( & mut self . end , n) ;
1229
1229
accum = f ( accum, n) ?;
1230
1230
}
1231
1231
1232
1232
self . exhausted = true ;
1233
1233
1234
1234
if self . start == self . end {
1235
- accum = f ( accum, self . start . clone ( ) ) ?;
1235
+ accum = f ( accum, self . start ) ?;
1236
1236
}
1237
1237
1238
1238
try { accum }
0 commit comments