Skip to content

Commit

Permalink
Fix issue with changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Barugon committed Dec 24, 2023
1 parent 7b49203 commit ab82a83
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,9 @@ mod inner {
}

pub fn set(&mut self, key: &str, item: String) {
if let Some(prev) = self.items.insert(key.to_owned(), item) {
if self.items.get(key).unwrap() != &prev {
self.changed.store(true, Ordering::Relaxed);
}
let prev = self.items.insert(key.to_owned(), item);
if self.items.get(key) != prev.as_ref() {
self.changed.store(true, Ordering::Relaxed);
}
}

Expand Down

0 comments on commit ab82a83

Please sign in to comment.