From 910a45b3d5d37df3f0d8a74580e2c49f3187b6f2 Mon Sep 17 00:00:00 2001 From: Johannes Becker Date: Wed, 21 Apr 2021 10:47:33 +0200 Subject: [PATCH] chore: cleanup clippy warnings --- matrix_sdk/src/client.rs | 13 ++++++++----- matrix_sdk/src/room/joined.rs | 5 ++++- matrix_sdk_base/src/client.rs | 11 ++++++----- matrix_sdk_base/src/store/mod.rs | 4 +++- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index 2c1f6877..a41a009a 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -95,7 +95,7 @@ use matrix_sdk_common::{ uiaa::AuthData, }, assign, - identifiers::{DeviceIdBox, EventId, RoomId, RoomIdOrAliasId, ServerName, UserId}, + identifiers::{DeviceIdBox, RoomId, RoomIdOrAliasId, ServerName, UserId}, instant::{Duration, Instant}, locks::RwLock, presence::PresenceState, @@ -104,11 +104,14 @@ use matrix_sdk_common::{ }; #[cfg(feature = "encryption")] -use matrix_sdk_common::api::r0::{ - keys::{get_keys, upload_keys, upload_signing_keys::Request as UploadSigningKeysRequest}, - to_device::send_event_to_device::{ - Request as RumaToDeviceRequest, Response as ToDeviceResponse, +use matrix_sdk_common::{ + api::r0::{ + keys::{get_keys, upload_keys, upload_signing_keys::Request as UploadSigningKeysRequest}, + to_device::send_event_to_device::{ + Request as RumaToDeviceRequest, Response as ToDeviceResponse, + }, }, + identifiers::EventId, }; use matrix_sdk_common::locks::Mutex; diff --git a/matrix_sdk/src/room/joined.rs b/matrix_sdk/src/room/joined.rs index 822f8fc4..0a66409d 100644 --- a/matrix_sdk/src/room/joined.rs +++ b/matrix_sdk/src/room/joined.rs @@ -1,5 +1,8 @@ use crate::{room::Common, BaseRoom, Client, Result, RoomType}; -use std::{io::Read, ops::Deref, sync::Arc}; +use std::{io::Read, ops::Deref}; + +#[cfg(feature = "encryption")] +use std::sync::Arc; use matrix_sdk_common::{ api::r0::{ diff --git a/matrix_sdk_base/src/client.rs b/matrix_sdk_base/src/client.rs index e53c77d1..8247cba4 100644 --- a/matrix_sdk_base/src/client.rs +++ b/matrix_sdk_base/src/client.rs @@ -31,10 +31,7 @@ use matrix_sdk_common::{ }, events::{ presence::PresenceEvent, - room::{ - history_visibility::HistoryVisibility, - member::{MemberEventContent, MembershipState}, - }, + room::member::{MemberEventContent, MembershipState}, AnyBasicEvent, AnyStrippedStateEvent, AnySyncRoomEvent, AnySyncStateEvent, AnyToDeviceEvent, EventContent, StateEvent, }, @@ -46,7 +43,10 @@ use matrix_sdk_common::{ #[cfg(feature = "encryption")] use matrix_sdk_common::{ api::r0::keys::claim_keys::Request as KeysClaimRequest, - events::{room::encrypted::EncryptedEventContent, AnyMessageEventContent, AnySyncMessageEvent}, + events::{ + room::{encrypted::EncryptedEventContent, history_visibility::HistoryVisibility}, + AnyMessageEventContent, AnySyncMessageEvent, + }, identifiers::DeviceId, locks::Mutex, uuid::Uuid, @@ -427,6 +427,7 @@ impl BaseClient { for event in ruma_timeline.events { match hoist_room_event_prev_content(&event) { Ok(mut e) => { + #[allow(clippy::single_match)] match &mut e { AnySyncRoomEvent::State(s) => match s { AnySyncStateEvent::RoomMember(member) => { diff --git a/matrix_sdk_base/src/store/mod.rs b/matrix_sdk_base/src/store/mod.rs index 3db1e379..bab5734b 100644 --- a/matrix_sdk_base/src/store/mod.rs +++ b/matrix_sdk_base/src/store/mod.rs @@ -15,10 +15,12 @@ use std::{ collections::{BTreeMap, BTreeSet}, ops::Deref, - path::Path, sync::Arc, }; +#[cfg(feature = "sled_state_store")] +use std::path::Path; + use dashmap::DashMap; use matrix_sdk_common::{ async_trait,