Skip to content

Commit

Permalink
use clone_from
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed May 8, 2024
1 parent b9c2e44 commit 9dee00b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rollback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl<K: Ord + Clone, V: Clone> RollbackableMap<K, V> {
for (key, old_value) in self.old_entries[snapshot..].iter().rev() {
changes
.entry(key.clone())
.and_modify(|(old, _)| *old = old_value.clone())
.and_modify(|(old, _): &mut (Option<V>, V)| old.clone_from(old_value))
.or_insert((old_value.clone(), self.map.get(key).unwrap().clone()));
}
changes
Expand Down

0 comments on commit 9dee00b

Please sign in to comment.