diff --git a/crates/ruma-common/src/events/room/encrypted.rs b/crates/ruma-common/src/events/room/encrypted.rs index c8d22f9e..3b054988 100644 --- a/crates/ruma-common/src/events/room/encrypted.rs +++ b/crates/ruma-common/src/events/room/encrypted.rs @@ -138,10 +138,17 @@ impl From> for Relation { #[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)] pub struct Replacement { - /// The ID of the event being replacing. + /// The ID of the event being replaced. pub event_id: OwnedEventId, } +impl Replacement { + /// Creates a new `Replacement` with the given event ID. + pub fn new(event_id: OwnedEventId) -> Self { + Self { event_id } + } +} + /// A reference to another event. #[derive(Clone, Debug, Deserialize, Serialize)] #[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]