Skip to content

Commit

Permalink
call core::mem::take
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokathor committed Dec 20, 2024
1 parent 023a973 commit 0924025
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/tinyvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,8 +840,7 @@ impl<A: Array> TinyVec<A> {

if let Some(x) = arr.try_insert(index, item) {
let mut v = Vec::with_capacity(arr.len() * 2);
let mut it =
arr.iter_mut().map(|r| core::mem::replace(r, Default::default()));
let mut it = arr.iter_mut().map(core::mem::take);
v.extend(it.by_ref().take(index));
v.push(x);
v.extend(it);
Expand Down

0 comments on commit 0924025

Please sign in to comment.