diff --git a/src/driver/tasks/udp_rx/mod.rs b/src/driver/tasks/udp_rx/mod.rs index 6f4a67249..fa8034180 100644 --- a/src/driver/tasks/udp_rx/mod.rs +++ b/src/driver/tasks/udp_rx/mod.rs @@ -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(), @@ -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(); diff --git a/src/manager.rs b/src/manager.rs index 9c1d13fe3..5f7e066a3 100644 --- a/src/manager.rs +++ b/src/manager.rs @@ -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()))), @@ -354,6 +352,16 @@ impl Songbird { } } +impl<'a> IntoIterator for &'a Songbird { + type Item = 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.