Skip to content

Commit

Permalink
Fix mutable reborrow
Browse files Browse the repository at this point in the history
Co-authored-by: bluss <bluss@users.noreply.github.com>
  • Loading branch information
niklasf and bluss committed Feb 22, 2021
1 parent 0cdb41f commit b9e755c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/arrayvec.rs
Expand Up @@ -503,8 +503,8 @@ impl<A: Array> ArrayVec<A> {
let mut g = BackshiftOnDrop { v: self, processed_len: 0, deleted_cnt: 0, original_len };

while g.processed_len < original_len {
let cur = unsafe { &mut *g.v.as_mut_ptr().add(g.processed_len) };
if !f(cur) {
let cur = unsafe { g.v.as_mut_ptr().add(g.processed_len) };
if !f(unsafe { &mut *cur }) {
g.processed_len += 1;
g.deleted_cnt += 1;
unsafe { ptr::drop_in_place(cur) };
Expand Down

0 comments on commit b9e755c

Please sign in to comment.