Skip to content

Commit

Permalink
Chore: Fix clippy warnings (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
fee1-dead authored and FelixMcFelix committed Nov 20, 2023
1 parent 5bc8430 commit 6e6d8e7
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,7 @@ impl Songbird {
/// Creates an iterator for all [`Call`]s currently managed.
pub fn iter(&self) -> Iter<'_> {
Iter {
inner: self
.calls
.iter()
.map(|x| (*x.key(), Arc::clone(&x.value()))),
inner: self.calls.iter().map(|x| (*x.key(), Arc::clone(x.value()))),
}
}

Expand Down Expand Up @@ -460,13 +457,14 @@ impl VoiceGatewayManager for Songbird {
}

type DashMapIter<'a> = dashmap::iter::Iter<'a, GuildId, Arc<Mutex<Call>>>;
type InnerIter<'a> = std::iter::Map<
DashMapIter<'a>,
fn(<DashMapIter<'a> as Iterator>::Item) -> (GuildId, Arc<Mutex<Call>>),
>;

/// An iterator over all [`Call`]s currently stored in the manager instance.
pub struct Iter<'a> {
inner: std::iter::Map<
DashMapIter<'a>,
fn(<DashMapIter<'a> as Iterator>::Item) -> (GuildId, Arc<Mutex<Call>>),
>,
inner: InnerIter<'a>,
}

impl<'a> Iterator for Iter<'a> {
Expand Down

0 comments on commit 6e6d8e7

Please sign in to comment.