Skip to content

Commit

Permalink
make miri happy
Browse files Browse the repository at this point in the history
  • Loading branch information
discord9 authored and seanmonstar committed Jul 13, 2023
1 parent 4f28cbd commit 78e3d37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/header/map.rs
Expand Up @@ -2098,22 +2098,22 @@ impl<'a, T> IterMut<'a, T> {
self.cursor = Some(Cursor::Head);
}

let entry = unsafe { &(*self.map).entries[self.entry] };
let entry = unsafe { &mut (*self.map).entries[self.entry] };

match self.cursor.unwrap() {
Head => {
self.cursor = entry.links.map(|l| Values(l.next));
Some((&entry.key, &entry.value as *const _ as *mut _))
Some((&entry.key, &mut entry.value as *mut _))
}
Values(idx) => {
let extra = unsafe { &(*self.map).extra_values[idx] };
let extra = unsafe { &mut (*self.map).extra_values[idx] };

match extra.next {
Link::Entry(_) => self.cursor = None,
Link::Extra(i) => self.cursor = Some(Values(i)),
}

Some((&entry.key, &extra.value as *const _ as *mut _))
Some((&entry.key, &mut extra.value as *mut _))
}
}
}
Expand Down

0 comments on commit 78e3d37

Please sign in to comment.