From 787d04190ecf944056f540fa5af4da32a9bd49c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 7 Feb 2024 13:21:21 +0100 Subject: [PATCH] Fix some more new clippy warnings --- bindings/matrix-sdk-ffi/src/room_member.rs | 2 +- .../matrix-sdk-ui/src/timeline/tests/event_filter.rs | 12 ++++++------ crates/matrix-sdk/src/oidc/backend/mock.rs | 4 ++-- crates/matrix-sdk/src/sliding_sync/mod.rs | 2 ++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bindings/matrix-sdk-ffi/src/room_member.rs b/bindings/matrix-sdk-ffi/src/room_member.rs index 1b84a5b7e..82e23b481 100644 --- a/bindings/matrix-sdk-ffi/src/room_member.rs +++ b/bindings/matrix-sdk-ffi/src/room_member.rs @@ -38,7 +38,7 @@ impl From for Membershi matrix_sdk::ruma::events::room::member::MembershipState::Leave => { MembershipState::Leave } - _ => todo!( + _ => unimplemented!( "Handle Custom case: https://github.com/matrix-org/matrix-rust-sdk/issues/1254" ), } diff --git a/crates/matrix-sdk-ui/src/timeline/tests/event_filter.rs b/crates/matrix-sdk-ui/src/timeline/tests/event_filter.rs index 92b78a13d..790fb7773 100644 --- a/crates/matrix-sdk-ui/src/timeline/tests/event_filter.rs +++ b/crates/matrix-sdk-ui/src/timeline/tests/event_filter.rs @@ -223,14 +223,14 @@ async fn event_type_filter_include_only_room_names() { timeline .handle_live_state_event( &ALICE, - RoomNameEventContent::new("A new room name".to_string()), + RoomNameEventContent::new("A new room name".to_owned()), None, ) .await; timeline .handle_live_state_event( &ALICE, - RoomNameEventContent::new("A new room name (again)".to_string()), + RoomNameEventContent::new("A new room name (again)".to_owned()), None, ) .await; @@ -238,7 +238,7 @@ async fn event_type_filter_include_only_room_names() { timeline .handle_live_state_event( &ALICE, - RoomTopicEventContent::new("A new room topic".to_string()), + RoomTopicEventContent::new("A new room topic".to_owned()), None, ) .await; @@ -272,14 +272,14 @@ async fn event_type_filter_exclude_messages() { timeline .handle_live_state_event( &ALICE, - RoomNameEventContent::new("A new room name".to_string()), + RoomNameEventContent::new("A new room name".to_owned()), None, ) .await; timeline .handle_live_state_event( &ALICE, - RoomNameEventContent::new("A new room name (again)".to_string()), + RoomNameEventContent::new("A new room name (again)".to_owned()), None, ) .await; @@ -287,7 +287,7 @@ async fn event_type_filter_exclude_messages() { timeline .handle_live_state_event( &ALICE, - RoomTopicEventContent::new("A new room topic".to_string()), + RoomTopicEventContent::new("A new room topic".to_owned()), None, ) .await; diff --git a/crates/matrix-sdk/src/oidc/backend/mock.rs b/crates/matrix-sdk/src/oidc/backend/mock.rs index 6915124db..de3573967 100644 --- a/crates/matrix-sdk/src/oidc/backend/mock.rs +++ b/crates/matrix-sdk/src/oidc/backend/mock.rs @@ -162,7 +162,7 @@ impl OidcBackend for MockImpl { _client_metadata: VerifiedClientMetadata, _software_statement: Option, ) -> Result { - todo!() + unimplemented!() } async fn build_par_authorization_url( @@ -172,7 +172,7 @@ impl OidcBackend for MockImpl { _authorization_endpoint: Url, _authorization_data: AuthorizationRequestData, ) -> Result<(Url, AuthorizationValidationData), OidcError> { - todo!() + unimplemented!() } async fn revoke_token( diff --git a/crates/matrix-sdk/src/sliding_sync/mod.rs b/crates/matrix-sdk/src/sliding_sync/mod.rs index 3bde7242b..9ffe486e3 100644 --- a/crates/matrix-sdk/src/sliding_sync/mod.rs +++ b/crates/matrix-sdk/src/sliding_sync/mod.rs @@ -1049,6 +1049,8 @@ fn compute_limited( #[cfg(test)] mod tests { + #![allow(clippy::dbg_macro)] + use std::{ collections::BTreeMap, future::ready,