Skip to content

Commit 404dd39

Browse files
committed
test: remove unused helpers
1 parent 693c8df commit 404dd39

File tree

4 files changed

+8
-42
lines changed

4 files changed

+8
-42
lines changed

testing/matrix-sdk-test/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ mod sync_builder;
120120
pub mod test_json;
121121

122122
pub use self::sync_builder::{
123-
bulk_room_members, EphemeralTestEvent, GlobalAccountDataTestEvent, InvitedRoomBuilder,
124-
JoinedRoomBuilder, KnockedRoomBuilder, LeftRoomBuilder, PresenceTestEvent,
125-
RoomAccountDataTestEvent, StateTestEvent, StrippedStateTestEvent, SyncResponseBuilder,
123+
bulk_room_members, GlobalAccountDataTestEvent, InvitedRoomBuilder, JoinedRoomBuilder,
124+
KnockedRoomBuilder, LeftRoomBuilder, PresenceTestEvent, RoomAccountDataTestEvent,
125+
StateTestEvent, StrippedStateTestEvent, SyncResponseBuilder,
126126
};
127127

128128
pub static ALICE: Lazy<&UserId> = Lazy::new(|| user_id!("@alice:server.name"));

testing/matrix-sdk-test/src/sync_builder/joined_room.rs

+2-17
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ use ruma::{
22
api::client::sync::sync_events::v3::JoinedRoom,
33
events::{
44
receipt::ReceiptEventContent, typing::TypingEventContent, AnyRoomAccountDataEvent,
5-
AnySyncEphemeralRoomEvent, AnySyncStateEvent, AnySyncTimelineEvent,
5+
AnySyncStateEvent, AnySyncTimelineEvent,
66
},
77
serde::Raw,
88
OwnedRoomId, RoomId,
99
};
1010
use serde_json::{from_value as from_json_value, Value as JsonValue};
1111

12-
use super::{EphemeralTestEvent, RoomAccountDataTestEvent, StateTestEvent};
12+
use super::{RoomAccountDataTestEvent, StateTestEvent};
1313
use crate::{event_factory::EventBuilder, DEFAULT_TEST_ROOM_ID};
1414

1515
pub struct JoinedRoomBuilder {
@@ -88,21 +88,6 @@ impl JoinedRoomBuilder {
8888
self
8989
}
9090

91-
/// Add an ephemeral event.
92-
pub fn add_ephemeral_event(mut self, event: EphemeralTestEvent) -> Self {
93-
self.inner.ephemeral.events.push(event.into_raw_event());
94-
self
95-
}
96-
97-
/// Add ephemeral events in bulk.
98-
pub fn add_ephemeral_bulk<I>(mut self, events: I) -> Self
99-
where
100-
I: IntoIterator<Item = Raw<AnySyncEphemeralRoomEvent>>,
101-
{
102-
self.inner.ephemeral.events.extend(events);
103-
self
104-
}
105-
10691
/// Add a single read receipt to the joined room's ephemeral events.
10792
pub fn add_receipt(mut self, f: EventBuilder<ReceiptEventContent>) -> Self {
10893
self.inner.ephemeral.events.push(f.into_raw());

testing/matrix-sdk-test/src/sync_builder/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ pub use joined_room::JoinedRoomBuilder;
2929
pub use knocked_room::KnockedRoomBuilder;
3030
pub use left_room::LeftRoomBuilder;
3131
pub use test_event::{
32-
EphemeralTestEvent, GlobalAccountDataTestEvent, PresenceTestEvent, RoomAccountDataTestEvent,
33-
StateTestEvent, StrippedStateTestEvent,
32+
GlobalAccountDataTestEvent, PresenceTestEvent, RoomAccountDataTestEvent, StateTestEvent,
33+
StrippedStateTestEvent,
3434
};
3535

3636
/// The `SyncResponseBuilder` struct can be used to easily generate valid sync

testing/matrix-sdk-test/src/sync_builder/test_event.rs

+1-20
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use ruma::{
22
events::{
33
presence::PresenceEvent, AnyGlobalAccountDataEvent, AnyRoomAccountDataEvent,
4-
AnyStrippedStateEvent, AnySyncEphemeralRoomEvent, AnySyncStateEvent,
4+
AnyStrippedStateEvent, AnySyncStateEvent,
55
},
66
serde::Raw,
77
};
@@ -112,25 +112,6 @@ impl RoomAccountDataTestEvent {
112112
}
113113
}
114114

115-
/// Test events that can be added to the ephemeral events.
116-
pub enum EphemeralTestEvent {
117-
Custom(JsonValue),
118-
}
119-
120-
impl EphemeralTestEvent {
121-
/// Get the JSON representation of this test event.
122-
pub fn into_json_value(self) -> JsonValue {
123-
match self {
124-
Self::Custom(json) => json,
125-
}
126-
}
127-
128-
/// Get the typed JSON representation of this test event.
129-
pub fn into_raw_event(self) -> Raw<AnySyncEphemeralRoomEvent> {
130-
from_json_value(self.into_json_value()).unwrap()
131-
}
132-
}
133-
134115
/// Test events that can be added to the presence events.
135116
pub enum PresenceTestEvent {
136117
Presence,

0 commit comments

Comments
 (0)