diff --git a/Makefile b/Makefile index 4a64fcd25..f51e42446 100644 --- a/Makefile +++ b/Makefile @@ -275,7 +275,6 @@ endif cargo.lint: cargo clippy --all -- -D clippy::pedantic -D warnings \ - -A clippy::enum_glob_use \ -A clippy::wildcard_imports diff --git a/crates/medea-coturn-telnet-client/src/client.rs b/crates/medea-coturn-telnet-client/src/client.rs index 9c0ee37d9..6cd6e0081 100644 --- a/crates/medea-coturn-telnet-client/src/client.rs +++ b/crates/medea-coturn-telnet-client/src/client.rs @@ -55,7 +55,8 @@ pub enum CoturnTelnetError { impl From for CoturnTelnetError { fn from(err: CoturnCliCodecError) -> Self { - use CoturnCliCodecError::*; + use CoturnCliCodecError::{BadResponse, IoFailed}; + match err { IoFailed(e) => Self::from(e), BadResponse(e) => Self::from(e), @@ -108,7 +109,7 @@ impl CoturnTelnetConnection { &mut self, username: String, ) -> Result, CoturnTelnetError> { - use CoturnTelnetError::*; + use CoturnTelnetError::{Disconnected, UnexpectedMessage}; self.0 .send(CoturnCliRequest::PrintSessions(username)) @@ -141,7 +142,7 @@ impl CoturnTelnetConnection { &mut self, session_id: String, ) -> Result<(), CoturnTelnetError> { - use CoturnTelnetError::*; + use CoturnTelnetError::{Disconnected, UnexpectedMessage}; self.0 .send(CoturnCliRequest::CloseSession(session_id)) @@ -193,7 +194,9 @@ impl CoturnTelnetConnection { /// - First message received is not [`CoturnCliResponse::EnterPassword`]. /// - Second message received is not [`CoturnCliResponse::Ready`]. async fn auth(&mut self, pass: Bytes) -> Result<(), CoturnTelnetError> { - use CoturnTelnetError::*; + use CoturnTelnetError::{ + Disconnected, UnexpectedMessage, WrongPassword, + }; let response = self.0.next().await.ok_or(Disconnected)??; if let CoturnCliResponse::EnterPassword = response { @@ -222,7 +225,7 @@ impl CoturnTelnetConnection { /// [Coturn]: https://github.com/coturn/coturn /// [Telnet]: https://en.wikipedia.org/wiki/Telnet pub async fn ping(&mut self) -> Result<(), CoturnTelnetError> { - use CoturnTelnetError::*; + use CoturnTelnetError::{Disconnected, UnexpectedMessage}; self.0.send(CoturnCliRequest::Ping).await?; diff --git a/crates/medea-coturn-telnet-client/src/proto.rs b/crates/medea-coturn-telnet-client/src/proto.rs index 8ed926e4e..da36811e0 100644 --- a/crates/medea-coturn-telnet-client/src/proto.rs +++ b/crates/medea-coturn-telnet-client/src/proto.rs @@ -102,7 +102,7 @@ impl TryFrom for CoturnCliResponse { type Error = CoturnResponseParseError; fn try_from(mut msg: BytesMut) -> Result { - use CoturnResponseParseError::*; + use CoturnResponseParseError::{BadResponseFormat, BadResponseType}; // delete cursor if message ends with it if msg.ends_with(CURSOR.as_bytes()) { @@ -165,7 +165,8 @@ pub enum CoturnCliRequest { impl From for Bytes { fn from(req: CoturnCliRequest) -> Self { - use CoturnCliRequest::*; + use CoturnCliRequest::{Auth, CloseSession, Ping, PrintSessions}; + match req { Auth(pass) => pass, PrintSessions(username) => format!("ps {}", username).into(), diff --git a/jason/CHANGELOG.md b/jason/CHANGELOG.md index c4ef2c1d6..91a7e0fa3 100644 --- a/jason/CHANGELOG.md +++ b/jason/CHANGELOG.md @@ -14,6 +14,7 @@ All user visible changes to this project will be documented in this file. This p ### BC Breaks - Library API: + - Replace `MediaStreamHandle` with `LocalMediaStream` and `RemoteMediaStream` ([#97]); - Expose `on_local_stream` callback in `Room` instead of `Jason` ([#54]); - Remove error argument from `on_local_stream` callback ([#54]); - Room initialization ([#46]): @@ -25,7 +26,7 @@ All user visible changes to this project will be documented in this file. This p - Media management: - Library API: - - Mute/unmute local video/audio ([#40], [#81]): + - Mute/unmute local video/audio ([#40], [#81], [#97]): - `Room.mute_audio()`; - `Room.unmute_audio()`; - `Room.mute_video()`; @@ -35,15 +36,15 @@ All user visible changes to this project will be documented in this file. This p - `MediaManager.enumerate_devices()`; - `MediaManager.init_local_stream()`. - Local media stream constraints: - - `MediaStreamConstraints`, `AudioTrackConstraints` classes ([#46]); + - `MediaStreamSettings`, `AudioTrackConstraints` classes ([#46], [#97]); - `DeviceVideoTrackConstraints`, `DisplayVideoTrackConstraints` classes ([#78]). - Room initialization ([#46]): - `Jason.init_room()`; - `Room.join()`; - - Ability to inject local video/audio stream into `Room` via `Room.inject_local_stream()` ([#54]); + - Ability to configure local media stream used by `Room` via `Room.set_local_media_settings()` ([#54], [#97]); - `Room.on_failed_local_stream` callback ([#54]); - `Room.on_close` callback for WebSocket close initiated by server ([#55]); - - `RtcIceTransportPolicy` configuration ([#79]). + - `RtcIceTransportPolicy` configuration ([#79]). - Room management: - Library API: - `Room.on_connection_loss` callback that JS side can start Jason reconnection on connection loss with ([#75]); @@ -77,6 +78,7 @@ All user visible changes to this project will be documented in this file. This p [#81]: /../../pull/81 [#87]: /../../pull/87 [#90]: /../../pull/90 +[#97]: /../../pull/97 diff --git a/jason/demo/index.html b/jason/demo/index.html index bf5d9a4bd..51c1ac204 100644 --- a/jason/demo/index.html +++ b/jason/demo/index.html @@ -10,7 +10,10 @@