diff --git a/jarust/tests/mocks/mock_transport.rs b/jarust/tests/mocks/mock_transport.rs index e4057e7..f702087 100644 --- a/jarust/tests/mocks/mock_transport.rs +++ b/jarust/tests/mocks/mock_transport.rs @@ -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), } } } diff --git a/jarust_plugins/examples/audio_bridge_mute_unmute.rs b/jarust_plugins/examples/audio_bridge_mute_unmute.rs index bd68410..5b4ad93 100644 --- a/jarust_plugins/examples/audio_bridge_mute_unmute.rs +++ b/jarust_plugins/examples/audio_bridge_mute_unmute.rs @@ -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 { diff --git a/jarust_plugins/examples/audio_bridge_mute_unmute_room.rs b/jarust_plugins/examples/audio_bridge_mute_unmute_room.rs index a0703b1..4ca3fb3 100644 --- a/jarust_plugins/examples/audio_bridge_mute_unmute_room.rs +++ b/jarust_plugins/examples/audio_bridge_mute_unmute_room.rs @@ -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 { diff --git a/jarust_plugins/src/audio_bridge/handle.rs b/jarust_plugins/src/audio_bridge/handle.rs index 484051e..69409bc 100644 --- a/jarust_plugins/src/audio_bridge/handle.rs +++ b/jarust_plugins/src/audio_bridge/handle.rs @@ -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,