diff --git a/livekit/src/room/mod.rs b/livekit/src/room/mod.rs index 801918e1..9d17d944 100644 --- a/livekit/src/room/mod.rs +++ b/livekit/src/room/mod.rs @@ -999,11 +999,7 @@ impl RoomSession { return; } - self.dispatcher.dispatch(&RoomEvent::SipDTMFReceived { - code, - digit, - participant, - }); + self.dispatcher.dispatch(&RoomEvent::SipDTMFReceived { code, digit, participant }); } /// Create a new participant diff --git a/livekit/src/room/participant/local_participant.rs b/livekit/src/room/participant/local_participant.rs index 23f62030..84c2b66a 100644 --- a/livekit/src/room/participant/local_participant.rs +++ b/livekit/src/room/participant/local_participant.rs @@ -271,7 +271,8 @@ impl LocalParticipant { } pub async fn publish_data(&self, packet: DataPacket) -> RoomResult<()> { - let destination_identities: Vec = packet.destination_identities.into_iter().map(Into::into).collect(); + let destination_identities: Vec = + packet.destination_identities.into_iter().map(Into::into).collect(); let data = proto::DataPacket { kind: packet.kind as i32, destination_identities: destination_identities.clone(), diff --git a/livekit/src/rtc_engine/mod.rs b/livekit/src/rtc_engine/mod.rs index 41d3ae7e..1a3f2c9e 100644 --- a/livekit/src/rtc_engine/mod.rs +++ b/livekit/src/rtc_engine/mod.rs @@ -29,6 +29,7 @@ use tokio::{ }; pub use self::rtc_session::SessionStats; +use crate::prelude::ParticipantIdentity; use crate::{ id::ParticipantSid, options::TrackPublishOptions, @@ -40,7 +41,6 @@ use crate::{ }, DataPacketKind, }; -use crate::prelude::ParticipantIdentity; pub mod lk_runtime; mod peer_transport; @@ -394,7 +394,7 @@ impl EngineInner { }); } } - SessionEvent::Data { participant_sid,participant_identity, payload, topic, kind } => { + SessionEvent::Data { participant_sid, participant_identity, payload, topic, kind } => { let _ = self.engine_tx.send(EngineEvent::Data { participant_sid, participant_identity, @@ -404,11 +404,8 @@ impl EngineInner { }); } SessionEvent::SipDTMF { participant_identity, code, digit } => { - let _ = self.engine_tx.send(EngineEvent::SipDTMF { - participant_identity, - code, - digit, - }); + let _ = + self.engine_tx.send(EngineEvent::SipDTMF { participant_identity, code, digit }); } SessionEvent::MediaTrack { track, stream, transceiver } => { let _ = self.engine_tx.send(EngineEvent::MediaTrack { track, stream, transceiver }); diff --git a/livekit/src/rtc_engine/rtc_session.rs b/livekit/src/rtc_engine/rtc_session.rs index 17597e60..1808a61e 100644 --- a/livekit/src/rtc_engine/rtc_session.rs +++ b/livekit/src/rtc_engine/rtc_session.rs @@ -41,6 +41,7 @@ use tokio::{ }; use super::{rtc_events, EngineError, EngineOptions, EngineResult, SimulateScenario}; +use crate::id::ParticipantIdentity; use crate::{ id::ParticipantSid, options::TrackPublishOptions, @@ -54,7 +55,6 @@ use crate::{ track::LocalTrack, DataPacketKind, }; -use crate::id::ParticipantIdentity; pub const ICE_CONNECT_TIMEOUT: Duration = Duration::from_secs(15); pub const TRACK_PUBLISH_TIMEOUT: Duration = Duration::from_secs(10); @@ -584,7 +584,8 @@ impl SessionInner { let _ = self.emitter.send(SessionEvent::Data { kind: data.kind().into(), participant_sid: participant_sid.map(|s| s.try_into().unwrap()), - participant_identity: participant_identity.map(|s| s.try_into().unwrap()), + participant_identity: participant_identity + .map(|s| s.try_into().unwrap()), payload: user.payload.clone(), topic: user.topic.clone(), }); @@ -595,14 +596,11 @@ impl SessionInner { .is_empty() .not() .then_some(data.participant_identity.clone()); - let digit = dtmf - .digit - .is_empty() - .not() - .then_some(dtmf.digit.clone()); + let digit = dtmf.digit.is_empty().not().then_some(dtmf.digit.clone()); let _ = self.emitter.send(SessionEvent::SipDTMF { - participant_identity: participant_identity.map(|s| s.try_into().unwrap()), + participant_identity: participant_identity + .map(|s| s.try_into().unwrap()), digit: digit.map(|s| s.try_into().unwrap()), code: dtmf.code, });