matrix-sdk: Fix some doc examples

master
Damir Jelić 2021-03-01 19:41:14 +01:00
parent 1f5cad136e
commit 5c0f0140e9
2 changed files with 7 additions and 3 deletions

View File

@ -1235,7 +1235,7 @@ impl Client {
/// use matrix_sdk_common::uuid::Uuid;
///
/// let content = AnyMessageEventContent::RoomMessage(
/// MessageEventContent::Text(TextMessageEventContent::plain("Hello world"))
/// MessageEventContent::text_plain("Hello world")
/// );
///
/// let txn_id = Uuid::new_v4();

View File

@ -273,7 +273,7 @@ pub enum CustomEvent<'c> {
/// # use matrix_sdk_base::{
/// # self,
/// # events::{
/// # room::message::{MessageEventContent, TextMessageEventContent},
/// # room::message::{MessageEventContent, MessageType, TextMessageEventContent},
/// # SyncMessageEvent
/// # },
/// # EventHandler, RoomState
@ -287,7 +287,11 @@ pub enum CustomEvent<'c> {
/// async fn on_room_message(&self, room: RoomState, event: &SyncMessageEvent<MessageEventContent>) {
/// if let RoomState::Joined(room) = room {
/// if let SyncMessageEvent {
/// content: MessageEventContent::Text(TextMessageEventContent { body: msg_body, .. }),
/// content:
/// MessageEventContent {
/// msgtype: MessageType::Text(TextMessageEventContent { body: msg_body, .. }),
/// ..
/// },
/// sender,
/// ..
/// } = event