docs(sdk): Simplify the event sending examples

master
Damir Jelić 2021-09-15 20:27:36 +02:00
parent 28412344d5
commit ff9bb94ab4
1 changed files with 2 additions and 5 deletions

View File

@ -377,9 +377,7 @@ impl Joined {
/// # let mut client = Client::new(homeserver)?;
/// # let room_id = room_id!("!test:localhost");
///
/// let content = AnyMessageEventContent::RoomMessage(
/// MessageEventContent::text_plain("Hello world")
/// );
/// let content = MessageEventContent::text_plain("Hello world");
///
/// let txn_id = Uuid::new_v4();
///
@ -652,12 +650,11 @@ impl Joined {
/// # let room_id = matrix_sdk::ruma::room_id!("!test:localhost");
///
/// let avatar_url = mxc_uri!("mxc://example.org/avatar");
/// let member_event = assign!(MemberEventContent::new(MembershipState::Join), {
/// let content = assign!(MemberEventContent::new(MembershipState::Join), {
/// avatar_url: Some(avatar_url),
/// });
///
/// if let Some(room) = client.get_joined_room(&room_id) {
/// let content = AnyStateEventContent::RoomMember(member_event);
/// room.send_state_event(content, "").await?;
/// }
/// # matrix_sdk::Result::Ok(()) });