Skip to content

Commit

Permalink
refactor: use or_default() instead of or_insert_with()
Browse files Browse the repository at this point in the history
Since rust1.73 was released, clippy recommends using or_default() - https://rust-lang.github.io/rust-clippy/master/index.html#/unwrap_or_default
  • Loading branch information
KevFan committed Oct 12, 2023
1 parent 591f7a0 commit ffaee76
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions limitador/src/storage/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ impl CounterStorage for InMemoryStorage {
let mut limits_by_namespace = self.limits_for_namespace.write().unwrap();
limits_by_namespace
.entry(limit.namespace().clone())
.or_insert_with(HashMap::new)
.or_default()
.entry(limit.clone())
.or_insert_with(AtomicExpiringValue::default);
.or_default();
}
Ok(())
}
Expand Down

0 comments on commit ffaee76

Please sign in to comment.