Skip to content

Commit

Permalink
Chore: Cleanup clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixMcFelix committed Nov 20, 2023
1 parent 1487da1 commit 91640f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/driver/tasks/udp_rx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl UdpRx {
Err(flume::RecvError::Disconnected) => break,
}
},
_ = tokio::time::sleep_until(playout_time) => {
() = tokio::time::sleep_until(playout_time) => {
let mut tick = VoiceTick {
speaking: HashMap::new(),
silent: HashSet::new(),
Expand All @@ -97,7 +97,7 @@ impl UdpRx {

drop(interconnect.events.send(EventMessage::FireCoreEvent(CoreContext::VoiceTick(tick))));
},
_ = tokio::time::sleep_until(cleanup_time) => {
() = tokio::time::sleep_until(cleanup_time) => {
// periodic cleanup.
let now = Instant::now();

Expand Down
12 changes: 10 additions & 2 deletions src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ impl Songbird {
}

/// Creates an iterator for all [`Call`]s currently managed.
// TODO: Implement IntoIterator
#[allow(clippy::iter_without_into_iter)]
pub fn iter(&self) -> Iter<'_> {
Iter {
inner: self.calls.iter().map(|x| (*x.key(), Arc::clone(x.value()))),
Expand Down Expand Up @@ -354,6 +352,16 @@ impl Songbird {
}
}

impl<'a> IntoIterator for &'a Songbird {
type Item = <Iter<'a> as Iterator>::Item;

type IntoIter = Iter<'a>;

fn into_iter(self) -> Self::IntoIter {
self.iter()
}
}

#[cfg(feature = "twilight")]
impl Songbird {
/// Handle events received on the cluster.
Expand Down

0 comments on commit 91640f6

Please sign in to comment.