Skip to content

Commit e35ba52

Browse files
committed
Don't replace self by empty slice in slice::take
1 parent 8dda5c4 commit e35ba52

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: library/core/src/slice/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -3240,8 +3240,7 @@ impl<T> [T] {
32403240
if split_index > self.len() {
32413241
return None;
32423242
}
3243-
let original = crate::mem::take(self);
3244-
let (front, back) = original.split_at(split_index);
3243+
let (front, back) = self.split_at(split_index);
32453244
if taking_front {
32463245
*self = back;
32473246
Some(front)

0 commit comments

Comments
 (0)