matrix-sdk: Fix some doc examples
This commit is contained in:
parent
1f5cad136e
commit
5c0f0140e9
2 changed files with 7 additions and 3 deletions
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue