Skip to content

Commit

Permalink
[refactor] Fixing storage type structure
Browse files Browse the repository at this point in the history
  • Loading branch information
didierofrivia committed Jul 10, 2023
1 parent 61bec5f commit 326986b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions limitador/src/storage/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ impl PartialEq for CounterKey {
}
}

type NamespacedLimitCounters<T> = HashMap<Namespace, HashMap<Limit, HashMap<CounterKey, T>>>;

pub struct InMemoryStorage {
//TODO: This is a bit ugly, to address in the future
#[allow(clippy::type_complexity)]
limits_for_namespace:
RwLock<HashMap<Namespace, HashMap<Limit, HashMap<CounterKey, ExpiringValue>>>>,
limits_for_namespace: RwLock<NamespacedLimitCounters<ExpiringValue>>,
}

impl CounterStorage for InMemoryStorage {
Expand Down

0 comments on commit 326986b

Please sign in to comment.