Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: applied clippy suggestions #99

Merged
merged 1 commit into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jarust/tests/mocks/mock_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl MockTransport {
let mut transport = Self::create_transport();
match transport.get_mock_server() {
Some(server) => Ok((transport, server)),
None => return Err(JaError::TransportNotOpened),
None => Err(JaError::TransportNotOpened),
}
}
}
Expand Down
33 changes: 15 additions & 18 deletions jarust_plugins/examples/audio_bridge_mute_unmute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,22 @@ async fn main() -> anyhow::Result<()> {

use jarust_plugins::audio_bridge::events::AudioBridgeEvent as ABE;
use jarust_plugins::audio_bridge::events::PluginEvent as PE;
match events.recv().await {
Some(PE::AudioBridgeEvent(ABE::RoomJoined { id, room, .. })) => {
handle
.mute(MuteOptions {
id: id.clone(),
room: room.clone(),
secret: None,
})
.await?;
if let Some(PE::AudioBridgeEvent(ABE::RoomJoined { id, room, .. })) = events.recv().await {
handle
.mute(MuteOptions {
id: id.clone(),
room: room.clone(),
secret: None,
})
.await?;

handle
.unmute(MuteOptions {
id,
room,
secret: None,
})
.await?;
}
_ => {}
handle
.unmute(MuteOptions {
id,
room,
secret: None,
})
.await?;
};

while let Some(e) = events.recv().await {
Expand Down
23 changes: 10 additions & 13 deletions jarust_plugins/examples/audio_bridge_mute_unmute_room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,17 @@ async fn main() -> anyhow::Result<()> {

use jarust_plugins::audio_bridge::events::AudioBridgeEvent as ABE;
use jarust_plugins::audio_bridge::events::PluginEvent as PE;
match events.recv().await {
Some(PE::AudioBridgeEvent(ABE::RoomJoined { room, .. })) => {
handle
.mute_room(MuteRoomOptions {
room: room.clone(),
secret: None,
})
.await?;
if let Some(PE::AudioBridgeEvent(ABE::RoomJoined { room, .. })) = events.recv().await {
handle
.mute_room(MuteRoomOptions {
room: room.clone(),
secret: None,
})
.await?;

handle
.unmute_room(MuteRoomOptions { room, secret: None })
.await?;
}
_ => {}
handle
.unmute_room(MuteRoomOptions { room, secret: None })
.await?;
};

while let Some(e) = events.recv().await {
Expand Down
1 change: 1 addition & 0 deletions jarust_plugins/src/audio_bridge/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ impl AudioBridgeHandle {
Ok(())
}

/// Change the room you are in, instead of leaving and joining a new room
pub async fn change_room(
&self,
room: Identifier,
Expand Down
Loading