Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
inetic committed Sep 13, 2024
1 parent c81ea72 commit 8b9a27a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
4 changes: 0 additions & 4 deletions lib/src/network/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ pub(super) struct Throughput {
}

impl Throughput {
pub fn new() -> Self {
Self::default()
}

/// Returns the current throughput (in bytes per second), given the current total amount of
/// bytes (sent or received) and the current time.
///
Expand Down
11 changes: 0 additions & 11 deletions lib/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -643,21 +643,10 @@ pub(crate) mod delay_map {
Some(item.value)
}

pub fn drain(&mut self) -> impl Iterator<Item = (K, V)> + '_ {
self.items.drain().map(|(key, item)| {
self.delays.remove(&item.delay_key);
(key, item.value)
})
}

pub fn len(&self) -> usize {
self.items.len()
}

// pub fn is_empty(&self) -> bool {
// self.items.is_empty()
// }

/// Poll for the next expired item. This can be wrapped in `future::poll_fn` and awaited.
/// Returns `Poll::Ready(None)` if the map is empty.
pub fn poll_expired(&mut self, cx: &mut Context<'_>) -> Poll<Option<(K, V)>> {
Expand Down
3 changes: 3 additions & 0 deletions lib/src/versioned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ impl<E> Container<E> for Vec<E> {
}

/// Container for outdated items that discards them.
// TODO: Clippy complains that `Discard` is never constructed in rust 1.81.0
// but wouldn't compile without `Default` because `Container` requires it.
#[allow(dead_code)]
#[derive(Default)]
pub(crate) struct Discard;

Expand Down

0 comments on commit 8b9a27a

Please sign in to comment.