diff --git a/ruma-events/src/room/message.rs b/ruma-events/src/room/message.rs index a28ba635..f573f51e 100644 --- a/ruma-events/src/room/message.rs +++ b/ruma-events/src/room/message.rs @@ -393,8 +393,14 @@ pub struct InReplyTo { impl TextMessageEventContent { /// A convenience constructor to create a plain text message - pub fn new_plain(body: impl Into) -> TextMessageEventContent { - TextMessageEventContent { body: body.into(), formatted: None, relates_to: None } + pub fn plain(body: impl Into) -> Self { + Self { body: body.into(), formatted: None, relates_to: None } + } + + /// A convenience constructor to create a plain text message + #[deprecated = "Renamed to plain"] + pub fn new_plain(body: impl Into) -> Self { + Self::plain(body) } } @@ -492,7 +498,7 @@ mod tests { #[test] fn plain_text_content_serialization() { - let message_event_content = MessageEventContent::Text(TextMessageEventContent::new_plain( + let message_event_content = MessageEventContent::Text(TextMessageEventContent::plain( "> <@test:example.com> test\n\ntest reply", ));