Skip to content

Commit a1a3d95

Browse files
committed
refactor(base): Remove the sliding_sync::http re-export.
This patch removes the `pub use ruma::api::client::sync::sync_events::v5 as http` re-export in `matrix_sdk_base::sliding_sync`.
1 parent 5f4e046 commit a1a3d95

File tree

15 files changed

+43
-40
lines changed

15 files changed

+43
-40
lines changed

crates/matrix-sdk-base/src/sliding_sync.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ use std::ops::Deref;
2020

2121
#[cfg(feature = "e2e-encryption")]
2222
use matrix_sdk_common::deserialized_responses::TimelineEvent;
23-
pub use ruma::api::client::sync::sync_events::v5 as http;
2423
use ruma::{
25-
api::client::sync::sync_events::v3::{self, InvitedRoom, KnockedRoom},
24+
api::client::sync::sync_events::{
25+
v3::{self, InvitedRoom, KnockedRoom},
26+
v5 as http,
27+
},
2628
events::{
2729
room::member::MembershipState, AnyRoomAccountDataEvent, AnyStrippedStateEvent,
2830
AnySyncStateEvent,
@@ -31,7 +33,7 @@ use ruma::{
3133
JsOption, OwnedRoomId, RoomId, UserId,
3234
};
3335
#[cfg(feature = "e2e-encryption")]
34-
use ruma::{api::client::sync::sync_events::v5, events::AnyToDeviceEvent, events::StateEventType};
36+
use ruma::{events::AnyToDeviceEvent, events::StateEventType};
3537
use tracing::{instrument, trace, warn};
3638

3739
use super::BaseClient;
@@ -65,8 +67,8 @@ impl BaseClient {
6567
/// Returns whether any change happened.
6668
pub async fn process_sliding_sync_e2ee(
6769
&self,
68-
to_device: Option<&v5::response::ToDevice>,
69-
e2ee: &v5::response::E2EE,
70+
to_device: Option<&http::response::ToDevice>,
71+
e2ee: &http::response::E2EE,
7072
) -> Result<Option<Vec<Raw<AnyToDeviceEvent>>>> {
7173
if to_device.is_none() && e2ee.is_empty() {
7274
return Ok(None);

crates/matrix-sdk-ui/src/encryption_sync_service.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ use async_stream::stream;
3232
use futures_core::stream::Stream;
3333
use futures_util::{pin_mut, StreamExt};
3434
use matrix_sdk::{sleep::sleep, Client, SlidingSync, LEASE_DURATION_MS};
35-
use matrix_sdk_base::sliding_sync::http;
36-
use ruma::assign;
35+
use ruma::{api::client::sync::sync_events::v5 as http, assign};
3736
use tokio::sync::OwnedMutexGuard;
3837
use tracing::{debug, instrument, trace, Span};
3938

crates/matrix-sdk-ui/src/notification_client.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,9 @@ use futures_util::{pin_mut, StreamExt as _};
2121
use matrix_sdk::{
2222
room::Room, sleep::sleep, Client, ClientBuildError, SlidingSyncList, SlidingSyncMode,
2323
};
24-
use matrix_sdk_base::{
25-
deserialized_responses::TimelineEvent, sliding_sync::http, RoomState, StoreError,
26-
};
24+
use matrix_sdk_base::{deserialized_responses::TimelineEvent, RoomState, StoreError};
2725
use ruma::{
26+
api::client::sync::sync_events::v5 as http,
2827
assign,
2928
directory::RoomTypeFilter,
3029
events::{

crates/matrix-sdk-ui/src/room_list_service/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ use matrix_sdk::{
6666
event_cache::EventCacheError, timeout::timeout, Client, Error as SlidingSyncError, SlidingSync,
6767
SlidingSyncList, SlidingSyncMode,
6868
};
69-
use matrix_sdk_base::sliding_sync::http;
7069
pub use room::*;
7170
pub use room_list::*;
72-
use ruma::{assign, directory::RoomTypeFilter, events::StateEventType, OwnedRoomId, RoomId, UInt};
71+
use ruma::{
72+
api::client::sync::sync_events::v5 as http, assign, directory::RoomTypeFilter,
73+
events::StateEventType, OwnedRoomId, RoomId, UInt,
74+
};
7375
pub use state::*;
7476
use thiserror::Error;
7577
use tracing::debug;

crates/matrix-sdk-ui/src/timeline/event_item/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -827,13 +827,14 @@ mod tests {
827827
use assert_matches2::assert_let;
828828
use matrix_sdk::test_utils::logged_in_client;
829829
use matrix_sdk_base::{
830-
deserialized_responses::TimelineEvent, latest_event::LatestEvent, sliding_sync::http,
831-
MinimalStateEvent, OriginalMinimalStateEvent,
830+
deserialized_responses::TimelineEvent, latest_event::LatestEvent, MinimalStateEvent,
831+
OriginalMinimalStateEvent,
832832
};
833833
use matrix_sdk_test::{
834834
async_test, event_factory::EventFactory, sync_state_event, sync_timeline_event,
835835
};
836836
use ruma::{
837+
api::client::sync::sync_events::v5 as http,
837838
event_id,
838839
events::{
839840
room::{

crates/matrix-sdk/src/sliding_sync/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ are **inclusive**) like so:
6868

6969
```rust
7070
# use matrix_sdk::sliding_sync::{SlidingSyncList, SlidingSyncMode};
71-
use matrix_sdk_base::sliding_sync::http;
72-
use ruma::assign;
71+
use ruma::{api::client::sync::sync_events::v5 as http, assign};
7372

7473
let list_builder = SlidingSyncList::builder("main_list")
7574
.sync_mode(SlidingSyncMode::new_selective().add_range(0..=9))
@@ -326,8 +325,7 @@ whenever a new set of timeline items is received by the server.
326325

327326
```rust,no_run
328327
use matrix_sdk::{Client, sliding_sync::{SlidingSyncList, SlidingSyncMode, Version}};
329-
use matrix_sdk_base::sliding_sync::http;
330-
use ruma::{assign, events::StateEventType};
328+
use ruma::{api::client::sync::sync_events::v5 as http, assign, events::StateEventType};
331329
use tracing::{warn, error, info, debug};
332330
use futures_util::{pin_mut, StreamExt};
333331
use url::Url;

crates/matrix-sdk/src/sliding_sync/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ use std::{
55
time::Duration,
66
};
77

8-
use matrix_sdk_base::sliding_sync::http;
98
use matrix_sdk_common::timer;
10-
use ruma::OwnedRoomId;
9+
use ruma::{api::client::sync::sync_events::v5 as http, OwnedRoomId};
1110
use tokio::sync::{broadcast::channel, Mutex as AsyncMutex, RwLock as AsyncRwLock};
1211

1312
use super::{

crates/matrix-sdk/src/sliding_sync/client.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use std::collections::BTreeMap;
22

33
use imbl::Vector;
4-
use matrix_sdk_base::{sliding_sync::http, sync::SyncResponse, PreviousEventsProvider};
4+
use matrix_sdk_base::{sync::SyncResponse, PreviousEventsProvider};
55
use ruma::{
6-
api::client::discovery::get_supported_versions, events::AnyToDeviceEvent, serde::Raw,
6+
api::client::{discovery::get_supported_versions, sync::sync_events::v5 as http},
7+
events::AnyToDeviceEvent,
8+
serde::Raw,
79
OwnedRoomId,
810
};
911
use tracing::error;

crates/matrix-sdk/src/sliding_sync/list/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use std::{
77
};
88

99
use eyeball::{Observable, SharedObservable};
10-
use matrix_sdk_base::sliding_sync::http;
11-
use ruma::events::StateEventType;
10+
use ruma::{api::client::sync::sync_events::v5 as http, events::StateEventType};
1211
use tokio::sync::broadcast::Sender;
1312

1413
use super::{

crates/matrix-sdk/src/sliding_sync/list/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ use std::{
1111

1212
use eyeball::{Observable, SharedObservable, Subscriber};
1313
use futures_core::Stream;
14-
use matrix_sdk_base::sliding_sync::http;
15-
use ruma::{assign, TransactionId};
14+
use ruma::{api::client::sync::sync_events::v5 as http, assign, TransactionId};
1615
use serde::{Deserialize, Serialize};
1716
use tokio::sync::broadcast::Sender;
1817
use tracing::{instrument, warn};

0 commit comments

Comments
 (0)