Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
dennwc committed Mar 28, 2024
1 parent 56545db commit 336c068
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 21 deletions.
6 changes: 1 addition & 5 deletions livekit/src/room/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion livekit/src/room/participant/local_participant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@ impl LocalParticipant {
}

pub async fn publish_data(&self, packet: DataPacket) -> RoomResult<()> {
let destination_identities: Vec<String> = packet.destination_identities.into_iter().map(Into::into).collect();
let destination_identities: Vec<String> =
packet.destination_identities.into_iter().map(Into::into).collect();
let data = proto::DataPacket {
kind: packet.kind as i32,
destination_identities: destination_identities.clone(),
Expand Down
11 changes: 4 additions & 7 deletions livekit/src/rtc_engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ use tokio::{
};

pub use self::rtc_session::SessionStats;
use crate::prelude::ParticipantIdentity;
use crate::{
id::ParticipantSid,
options::TrackPublishOptions,
Expand All @@ -40,7 +41,6 @@ use crate::{
},
DataPacketKind,
};
use crate::prelude::ParticipantIdentity;

pub mod lk_runtime;
mod peer_transport;
Expand Down Expand Up @@ -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,
Expand All @@ -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 });
Expand Down
14 changes: 6 additions & 8 deletions livekit/src/rtc_engine/rtc_session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use tokio::{
};

use super::{rtc_events, EngineError, EngineOptions, EngineResult, SimulateScenario};
use crate::id::ParticipantIdentity;
use crate::{
id::ParticipantSid,
options::TrackPublishOptions,
Expand All @@ -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);
Expand Down Expand Up @@ -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(),
});
Expand All @@ -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,
});
Expand Down

0 comments on commit 336c068

Please sign in to comment.