Rename TextMessageEventContent::new_plain to plain
This commit is contained in:
parent
76c2f5c449
commit
f56b530dc3
@ -393,8 +393,14 @@ pub struct InReplyTo {
|
|||||||
|
|
||||||
impl TextMessageEventContent {
|
impl TextMessageEventContent {
|
||||||
/// A convenience constructor to create a plain text message
|
/// A convenience constructor to create a plain text message
|
||||||
pub fn new_plain(body: impl Into<String>) -> TextMessageEventContent {
|
pub fn plain(body: impl Into<String>) -> Self {
|
||||||
TextMessageEventContent { body: body.into(), formatted: None, relates_to: None }
|
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<String>) -> Self {
|
||||||
|
Self::plain(body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -492,7 +498,7 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn plain_text_content_serialization() {
|
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",
|
"> <@test:example.com> test\n\ntest reply",
|
||||||
));
|
));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user