@@ -22,9 +22,9 @@ use std::collections::BTreeMap;
22
22
23
23
/// Same trait as [`std::convert::From`].
24
24
///
25
- /// Because we are converting types that all live in another
26
- // crate (`ruma`), we cannot implement `From` on them, so we
27
- // need a custom local trait, hence this `From` trait.
25
+ /// Because we are converting types that all live in another crate (`ruma`), we
26
+ /// cannot implement `From` on them, so we need a custom local trait, hence this
27
+ /// `From` trait.
28
28
pub trait From < T > : Sized {
29
29
/// See [`std::convert::From::from`].
30
30
fn from ( value : T ) -> Self ;
60
60
61
61
/// Same trait as [`std::convert::Into`].
62
62
///
63
- /// Because we are converting types that all live in another
64
- // crate (`ruma`), we cannot implement `Into` on them, so we
65
- // need a custom local trait, hence this `Into` trait.
63
+ /// Because we are converting types that all live in another crate (`ruma`), we
64
+ /// cannot implement `Into` on them, so we need a custom local trait, hence this
65
+ /// `Into` trait.
66
66
pub trait Into < T > : Sized {
67
67
/// See [`std::convert::Into::into`].
68
68
#[ must_use]
@@ -82,36 +82,26 @@ where
82
82
83
83
/// HTTP types from MSC3575, renamed to match the Simplified MSC3575 namings.
84
84
pub mod msc3575 {
85
- use super :: { simplified_msc3575 as sss, From } ;
86
85
use ruma:: { api:: client:: sync:: sync_events:: v4, events:: TimelineEventType } ;
87
-
88
- // Request types.
89
86
pub use v4:: {
90
- ExtensionsConfig as RequestExtensions , Request , RoomDetailsConfig as RequestRoomDetails ,
91
- RoomSubscription as RequestRoomSubscription , SyncRequestList as RequestList ,
87
+ Extensions as ResponseExtensions , ExtensionsConfig as RequestExtensions , Request , Response ,
88
+ RoomDetailsConfig as RequestRoomDetails , RoomSubscription as RequestRoomSubscription ,
89
+ SlidingSyncRoom as ResponseRoom , SlidingSyncRoomHero as ResponseRoomHero ,
90
+ SyncList as ResponseList , SyncRequestList as RequestList ,
92
91
SyncRequestListFilters as RequestListFilters ,
93
92
} ;
94
93
95
- // Response types.
96
- pub use v4:: {
97
- Extensions as ResponseExtensions , Response , SlidingSyncRoom as ResponseRoom ,
98
- SlidingSyncRoomHero as ResponseRoomHero , SyncList as ResponseList ,
99
- } ;
94
+ use super :: { simplified_msc3575 as sss, From } ;
100
95
101
96
/// HTTP types for MSC3575 extensions, renamed to match the Simplified
102
97
/// MSC3575 namings.
103
98
pub mod extensions {
104
- // Request types.
105
99
pub use super :: v4:: {
106
- AccountDataConfig as RequestAccountData , E2EEConfig as RequestE2EE ,
100
+ AccountData as ResponseAccountData , AccountDataConfig as RequestAccountData ,
101
+ E2EEConfig as RequestE2EE , Receipts as ResponseReceipts ,
107
102
ReceiptsConfig as RequestReceipts , RoomReceiptConfig as RequestReceiptsRoom ,
108
- ToDeviceConfig as RequestToDevice , TypingConfig as RequestTyping ,
109
- } ;
110
-
111
- // Response types.
112
- pub use super :: v4:: {
113
- AccountData as ResponseAccountData , Receipts as ResponseReceipts ,
114
- ToDevice as ResponseToDevice , Typing as ResponseTyping , E2EE as ResponseE2EE ,
103
+ ToDevice as ResponseToDevice , ToDeviceConfig as RequestToDevice ,
104
+ Typing as ResponseTyping , TypingConfig as RequestTyping , E2EE as ResponseE2EE ,
115
105
} ;
116
106
}
117
107
@@ -272,9 +262,10 @@ pub mod msc3575 {
272
262
273
263
/// HTTP types from Simplified MSC3575.
274
264
pub mod simplified_msc3575 {
275
- use super :: { msc3575 as ss, From } ;
276
265
pub use ruma:: api:: client:: sync:: sync_events:: v5:: * ;
277
266
267
+ use super :: { msc3575 as ss, From } ;
268
+
278
269
impl From < ss:: Response > for Response {
279
270
fn from ( value : ss:: Response ) -> Self {
280
271
let mut s = Self :: new ( value. pos ) ;
0 commit comments