From da3f550bc317dea1a5700298ad58cf745f667b1f Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 7 Jan 2025 20:00:09 +0100 Subject: [PATCH] Clean up some imports With experimental-sliding-sync enabled and e2e-encryption disabled, there were a bunch of warnings about unused imports. This fixes them (but a few warnings about other unused items remain). --- crates/matrix-sdk-base/src/latest_event.rs | 22 ++++++++----------- .../matrix-sdk-base/src/sliding_sync/mod.rs | 17 +++++++------- 2 files changed, 17 insertions(+), 22 deletions(-) diff --git a/crates/matrix-sdk-base/src/latest_event.rs b/crates/matrix-sdk-base/src/latest_event.rs index ccedb842edb..7884d585193 100644 --- a/crates/matrix-sdk-base/src/latest_event.rs +++ b/crates/matrix-sdk-base/src/latest_event.rs @@ -5,24 +5,20 @@ use matrix_sdk_common::deserialized_responses::SyncTimelineEvent; #[cfg(feature = "e2e-encryption")] -use ruma::events::{ - call::{invite::SyncCallInviteEvent, notify::SyncCallNotifyEvent}, - poll::unstable_start::SyncUnstablePollStartEvent, - relation::RelationType, - room::message::SyncRoomMessageEvent, - AnySyncMessageLikeEvent, AnySyncTimelineEvent, -}; use ruma::{ events::{ - room::{ - member::{MembershipState, SyncRoomMemberEvent}, - power_levels::RoomPowerLevels, - }, + call::{invite::SyncCallInviteEvent, notify::SyncCallNotifyEvent}, + poll::unstable_start::SyncUnstablePollStartEvent, + relation::RelationType, + room::member::{MembershipState, SyncRoomMemberEvent}, + room::message::SyncRoomMessageEvent, + room::power_levels::RoomPowerLevels, sticker::SyncStickerEvent, - AnySyncStateEvent, + AnySyncMessageLikeEvent, AnySyncStateEvent, AnySyncTimelineEvent, }, - MxcUri, OwnedEventId, UserId, + UserId, }; +use ruma::{MxcUri, OwnedEventId}; use serde::{Deserialize, Serialize}; use crate::MinimalRoomMemberEvent; diff --git a/crates/matrix-sdk-base/src/sliding_sync/mod.rs b/crates/matrix-sdk-base/src/sliding_sync/mod.rs index d8a96aa34a6..a5b7d726c3d 100644 --- a/crates/matrix-sdk-base/src/sliding_sync/mod.rs +++ b/crates/matrix-sdk-base/src/sliding_sync/mod.rs @@ -22,26 +22,20 @@ use std::{borrow::Cow, collections::BTreeMap}; #[cfg(feature = "e2e-encryption")] use matrix_sdk_common::deserialized_responses::SyncTimelineEvent; -#[cfg(feature = "e2e-encryption")] -use ruma::api::client::sync::sync_events::v5; -#[cfg(feature = "e2e-encryption")] -use ruma::events::AnyToDeviceEvent; use ruma::{ api::client::sync::sync_events::v3::{self, InvitedRoom, KnockedRoom}, events::{ room::member::MembershipState, AnyRoomAccountDataEvent, AnyStrippedStateEvent, - AnySyncStateEvent, StateEventType, + AnySyncStateEvent, }, serde::Raw, JsOption, OwnedRoomId, RoomId, UInt, UserId, }; +#[cfg(feature = "e2e-encryption")] +use ruma::{api::client::sync::sync_events::v5, events::AnyToDeviceEvent, events::StateEventType}; use tracing::{debug, error, instrument, trace, warn}; use super::BaseClient; -#[cfg(feature = "e2e-encryption")] -use crate::latest_event::{is_suitable_for_latest_event, LatestEvent, PossibleLatestEvent}; -#[cfg(feature = "e2e-encryption")] -use crate::RoomMemberships; use crate::{ error::Result, read_receipts::{compute_unread_counts, PreviousEventsProvider}, @@ -55,6 +49,11 @@ use crate::{ sync::{JoinedRoomUpdate, LeftRoomUpdate, Notification, RoomUpdates, SyncResponse}, Room, RoomInfo, }; +#[cfg(feature = "e2e-encryption")] +use crate::{ + latest_event::{is_suitable_for_latest_event, LatestEvent, PossibleLatestEvent}, + RoomMemberships, +}; impl BaseClient { #[cfg(feature = "e2e-encryption")]