From f2e1eb25ccaa9dbddfc3c88d726399795f9782f5 Mon Sep 17 00:00:00 2001 From: rogurotus Date: Fri, 25 Aug 2023 11:13:25 +0300 Subject: [PATCH] fix clippy --- flutter/example/pubspec.lock | 34 ++++++++------ flutter/lib/src/native/ffi/jason_api.g.dart | 51 +++++++++++---------- mock/control-api/src/callback/server.rs | 1 + src/room.rs | 2 + src/rpc/websocket/client.rs | 9 ++-- 5 files changed, 53 insertions(+), 44 deletions(-) diff --git a/flutter/example/pubspec.lock b/flutter/example/pubspec.lock index 192486e93..73372da57 100644 --- a/flutter/example/pubspec.lock +++ b/flutter/example/pubspec.lock @@ -101,10 +101,10 @@ packages: dependency: transitive description: name: collection - sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.1" + version: "1.17.2" colorize: dependency: transitive description: @@ -310,18 +310,18 @@ packages: dependency: transitive description: name: matcher - sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.15" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" medea_flutter_webrtc: dependency: "direct main" description: @@ -490,10 +490,10 @@ packages: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -538,10 +538,10 @@ packages: dependency: transitive description: name: test_api - sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.6.0" tuple: dependency: transitive description: @@ -578,10 +578,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f6deed8ed625c52864792459709183da231ebf66ff0cf09e69b573227c377efe + sha256: c620a6f783fa22436da68e42db7ebbf18b8c44b9a46ab911f666ff09ffd9153f url: "https://pub.dev" source: hosted - version: "11.3.0" + version: "11.7.1" watcher: dependency: transitive description: @@ -590,6 +590,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + url: "https://pub.dev" + source: hosted + version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -615,5 +623,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.0.0 <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.10.0" diff --git a/flutter/lib/src/native/ffi/jason_api.g.dart b/flutter/lib/src/native/ffi/jason_api.g.dart index a2108dd9c..42cc80bde 100644 --- a/flutter/lib/src/native/ffi/jason_api.g.dart +++ b/flutter/lib/src/native/ffi/jason_api.g.dart @@ -3838,7 +3838,8 @@ class MedeaJasonWire implements FlutterRustBridgeWireBase { late final _wire_media_manager_handle_microphone_volume_is_availablePtr = _lookup< - ffi.NativeFunction< + ffi + .NativeFunction< WireSyncReturn Function(wire_MediaManagerHandle)>>( 'wire_media_manager_handle_microphone_volume_is_available'); late final _wire_media_manager_handle_microphone_volume_is_available = @@ -4535,9 +4536,9 @@ class MedeaJasonWire implements FlutterRustBridgeWireBase { } late final _new_box_autoadd_api_constrain_facing_mode_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer - Function()>>('new_box_autoadd_api_constrain_facing_mode_0'); + ffi + .NativeFunction Function()>>( + 'new_box_autoadd_api_constrain_facing_mode_0'); late final _new_box_autoadd_api_constrain_facing_mode_0 = _new_box_autoadd_api_constrain_facing_mode_0Ptr .asFunction Function()>(); @@ -4576,9 +4577,9 @@ class MedeaJasonWire implements FlutterRustBridgeWireBase { } late final _new_box_autoadd_api_media_stream_settings_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer - Function()>>('new_box_autoadd_api_media_stream_settings_0'); + ffi + .NativeFunction Function()>>( + 'new_box_autoadd_api_media_stream_settings_0'); late final _new_box_autoadd_api_media_stream_settings_0 = _new_box_autoadd_api_media_stream_settings_0Ptr .asFunction Function()>(); @@ -4632,9 +4633,9 @@ class MedeaJasonWire implements FlutterRustBridgeWireBase { } late final _new_uint_8_list_0Ptr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int32)>>('new_uint_8_list_0'); + ffi + .NativeFunction Function(ffi.Int32)>>( + 'new_uint_8_list_0'); late final _new_uint_8_list_0 = _new_uint_8_list_0Ptr .asFunction Function(int)>(); @@ -4849,9 +4850,9 @@ class MedeaJasonWire implements FlutterRustBridgeWireBase { } late final _inflate_ApiConstrainFacingMode_ExactPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer - Function()>>('inflate_ApiConstrainFacingMode_Exact'); + ffi + .NativeFunction Function()>>( + 'inflate_ApiConstrainFacingMode_Exact'); late final _inflate_ApiConstrainFacingMode_Exact = _inflate_ApiConstrainFacingMode_ExactPtr .asFunction Function()>(); @@ -4862,9 +4863,9 @@ class MedeaJasonWire implements FlutterRustBridgeWireBase { } late final _inflate_ApiConstrainFacingMode_IdealPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer - Function()>>('inflate_ApiConstrainFacingMode_Ideal'); + ffi + .NativeFunction Function()>>( + 'inflate_ApiConstrainFacingMode_Ideal'); late final _inflate_ApiConstrainFacingMode_Ideal = _inflate_ApiConstrainFacingMode_IdealPtr .asFunction Function()>(); @@ -4988,9 +4989,9 @@ class MedeaJasonWire implements FlutterRustBridgeWireBase { } late final _set_video_constraint_valuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Handle, ffi.Int64, DartValue)>>('set_video_constraint_value'); + ffi + .NativeFunction>( + 'set_video_constraint_value'); late final _set_video_constraint_value = _set_video_constraint_valuePtr .asFunction(); @@ -5007,9 +5008,9 @@ class MedeaJasonWire implements FlutterRustBridgeWireBase { } late final _set_audio_constraint_valuePtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Handle, ffi.Int64, DartValue)>>('set_audio_constraint_value'); + ffi + .NativeFunction>( + 'set_audio_constraint_value'); late final _set_audio_constraint_value = _set_audio_constraint_valuePtr .asFunction(); @@ -5988,9 +5989,9 @@ class MedeaJasonWire implements FlutterRustBridgeWireBase { } late final _Callback__callPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, DartValue)>>('Callback__call'); + ffi + .NativeFunction, DartValue)>>( + 'Callback__call'); late final _Callback__call = _Callback__callPtr.asFunction< void Function(ffi.Pointer, DartValue)>(); diff --git a/mock/control-api/src/callback/server.rs b/mock/control-api/src/callback/server.rs index 993252b00..8c386ac40 100644 --- a/mock/control-api/src/callback/server.rs +++ b/mock/control-api/src/callback/server.rs @@ -86,6 +86,7 @@ impl Handler for GrpcCallbackServer { /// # Panics /// /// If cannot bind and run gRPC server. +#[allow(clippy::unused_async)] pub async fn run(opts: &Cli) -> Addr { let events = Arc::new(Mutex::new(Vec::new())); diff --git a/src/room.rs b/src/room.rs index ef942771e..8c9d0d4e0 100644 --- a/src/room.rs +++ b/src/room.rs @@ -404,6 +404,7 @@ impl RoomHandle { /// /// Helper function for all the exported mute/unmute/enable/disable /// audio/video send/receive methods. + #[allow(clippy::redundant_closure_call)] fn change_media_state( &self, new_state: S, @@ -1443,6 +1444,7 @@ impl InnerRoom { /// [`Sender`]: peer::media::Sender /// [1]: https://tinyurl.com/rnxcavf #[async_recursion(?Send)] + #[allow(clippy::redundant_closure_call)] async fn set_local_media_settings( &self, new_settings: MediaStreamSettings, diff --git a/src/rpc/websocket/client.rs b/src/rpc/websocket/client.rs index e3fa7155b..2c8228dfa 100644 --- a/src/rpc/websocket/client.rs +++ b/src/rpc/websocket/client.rs @@ -355,11 +355,11 @@ impl WebSocketRpcClient { /// Starts [`Heartbeat`] with provided [`RpcSettings`] for provided /// [`platform::RpcTransport`]. - async fn start_heartbeat( + fn start_heartbeat( self: Rc, transport: Rc, rpc_settings: RpcSettings, - ) -> Result<(), Traced> { + ) { let idle_timeout = IdleTimeout(Duration::from_millis( rpc_settings.idle_timeout_ms.into(), )); @@ -380,8 +380,6 @@ impl WebSocketRpcClient { } }); self.0.borrow_mut().heartbeat = Some(heartbeat); - - Ok(()) } /// Tries to establish [`WebSocketRpcClient`] connection. @@ -409,8 +407,7 @@ impl WebSocketRpcClient { if let Some(msg) = on_message.next().await { if let ServerMsg::RpcSettings(rpc_settings) = msg { Rc::clone(&self) - .start_heartbeat(Rc::clone(&transport), rpc_settings) - .await?; + .start_heartbeat(Rc::clone(&transport), rpc_settings); } else { let close_reason = ClosedStateReason::FirstServerMsgIsNotRpcSettings;