Skip to content

Commit

Permalink
#69 write instead of :=
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Apr 25, 2023
1 parent 7d24bde commit a47cb20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/map.rs
Expand Up @@ -88,7 +88,7 @@ impl<K: PartialEq + Clone, V: Clone, const N: usize> Map<K, V, N> {
let p = unsafe { self.pairs[i].assume_init_ref() };
if let Present((bk, _bv)) = &p {
if bk == k {
self.pairs[i] = MaybeUninit::new(Absent);
self.pairs[i].write(Absent);
break;
}
}
Expand Down Expand Up @@ -172,7 +172,7 @@ impl<K: PartialEq + Clone, V: Clone, const N: usize> Map<K, V, N> {
let p = unsafe { self.pairs[i].assume_init_ref() };
if let Present((k, v)) = &p {
if !f(k, v) {
self.pairs[i] = MaybeUninit::new(Absent);
self.pairs[i].write(Absent);
}
}
}
Expand Down

0 comments on commit a47cb20

Please sign in to comment.