Skip to content

Commit

Permalink
Try using ref to raw conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaeroxe committed Sep 12, 2017
1 parent 4817754 commit 4de0cf1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/liballoc/vec.rs
Expand Up @@ -2692,8 +2692,8 @@ impl<'a, T, F> Iterator for DrainFilter<'a, T, F>
return Some(ptr::read(&v[i]));
} else if self.del > 0 {
let del = self.del;
let src = self.vec.as_ptr().offset(i);
let dst = self.vec.as_mut_ptr().offset(i - del);
let src: *const T = &v[i];
let dst: *mut T = &mut v[i - del];
ptr::copy_nonoverlapping(src, dst, 1);
}
}
Expand Down

0 comments on commit 4de0cf1

Please sign in to comment.