diff --git a/testing/matrix-sdk-test/src/sync_builder/mod.rs b/testing/matrix-sdk-test/src/sync_builder/mod.rs index 01a061a3f..56fc20845 100644 --- a/testing/matrix-sdk-test/src/sync_builder/mod.rs +++ b/testing/matrix-sdk-test/src/sync_builder/mod.rs @@ -16,8 +16,6 @@ use ruma::{ }; use serde_json::{Value as JsonValue, from_value as from_json_value, json}; -use super::test_json; - mod bulk; mod invited_room; mod joined_room; @@ -30,7 +28,7 @@ pub use invited_room::InvitedRoomBuilder; pub use joined_room::JoinedRoomBuilder; pub use knocked_room::KnockedRoomBuilder; pub use left_room::LeftRoomBuilder; -pub use test_event::{PresenceTestEvent, RoomAccountDataTestEvent, StrippedStateTestEvent}; +pub use test_event::{PresenceTestEvent, RoomAccountDataTestEvent}; /// The `SyncResponseBuilder` struct can be used to easily generate valid sync /// responses for testing. These can be then fed into either `Client` or `Room`. @@ -115,10 +113,7 @@ impl SyncResponseBuilder { /// Add a presence event. pub fn add_presence_event(&mut self, event: PresenceTestEvent) -> &mut Self { - let val = match event { - PresenceTestEvent::Presence => test_json::PRESENCE.to_owned(), - PresenceTestEvent::Custom(json) => json, - }; + let PresenceTestEvent::Custom(val) = event; self.presence.push(from_json_value(val).unwrap()); self diff --git a/testing/matrix-sdk-test/src/sync_builder/test_event.rs b/testing/matrix-sdk-test/src/sync_builder/test_event.rs index e06ccb933..2ae0f64ae 100644 --- a/testing/matrix-sdk-test/src/sync_builder/test_event.rs +++ b/testing/matrix-sdk-test/src/sync_builder/test_event.rs @@ -8,16 +8,12 @@ use crate::test_json; /// Test events that can be added to the stripped state. pub enum StrippedStateTestEvent { - Member, - RoomName, Custom(JsonValue), } impl From for JsonValue { fn from(val: StrippedStateTestEvent) -> Self { match val { - StrippedStateTestEvent::Member => test_json::sync_events::MEMBER_STRIPPED.to_owned(), - StrippedStateTestEvent::RoomName => test_json::sync_events::NAME_STRIPPED.to_owned(), StrippedStateTestEvent::Custom(json) => json, } } @@ -32,7 +28,6 @@ impl From for Raw { /// Test events that can be added to the room account data. pub enum RoomAccountDataTestEvent { FullyRead, - Tags, MarkedUnread, Custom(JsonValue), } @@ -41,7 +36,6 @@ impl From for JsonValue { fn from(val: RoomAccountDataTestEvent) -> Self { match val { RoomAccountDataTestEvent::FullyRead => test_json::sync_events::FULLY_READ.to_owned(), - RoomAccountDataTestEvent::Tags => test_json::sync_events::TAG.to_owned(), RoomAccountDataTestEvent::MarkedUnread => { test_json::sync_events::MARKED_UNREAD.to_owned() } @@ -58,14 +52,12 @@ impl From for Raw { /// Test events that can be added to the presence events. pub enum PresenceTestEvent { - Presence, Custom(JsonValue), } impl From for JsonValue { fn from(val: PresenceTestEvent) -> Self { match val { - PresenceTestEvent::Presence => test_json::sync_events::PRESENCE.to_owned(), PresenceTestEvent::Custom(json) => json, } }