We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
self
slice::take
1 parent 8dda5c4 commit e35ba52Copy full SHA for e35ba52
library/core/src/slice/mod.rs
@@ -3240,8 +3240,7 @@ impl<T> [T] {
3240
if split_index > self.len() {
3241
return None;
3242
}
3243
- let original = crate::mem::take(self);
3244
- let (front, back) = original.split_at(split_index);
+ let (front, back) = self.split_at(split_index);
3245
if taking_front {
3246
*self = back;
3247
Some(front)
0 commit comments