Skip to content

Commit

Permalink
Merge pull request #218 from KevFan/rust1.73
Browse files Browse the repository at this point in the history
refactor: use or_default() instead of or_insert_with()
  • Loading branch information
KevFan authored Oct 12, 2023
2 parents 591f7a0 + ffaee76 commit 38f55ca
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 38f55ca

Please sign in to comment.