Skip to content

Commit

Permalink
fragment pool: fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eugene-babichenko committed Apr 6, 2021
1 parent ba4a85e commit 58f6ce8
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions jormungandr/src/fragment/pool.rs
Expand Up @@ -218,9 +218,13 @@ pub(super) mod internal {
self.tail = &mut *entry;
}
self.head = &mut *entry;
self.index
if self
.index
.insert(IndexedDequeueKeyRef(&entry.key), entry)
.map(|_| panic!("inserted an already existing key"));
.is_some()
{
panic!("inserted an already existing key");
}
}

fn push_back(&mut self, key: K, value: V) {
Expand All @@ -236,9 +240,13 @@ pub(super) mod internal {
self.head = &mut *entry;
}
self.tail = &mut *entry;
self.index
if self
.index
.insert(IndexedDequeueKeyRef(&entry.key), entry)
.map(|_| panic!("inserted an already existing key"));
.is_some()
{
panic!("inserted an already existing key");
}
}

fn pop_back(&mut self) -> Option<(K, V)> {
Expand Down

0 comments on commit 58f6ce8

Please sign in to comment.