diff --git a/crates/matrix-sdk/examples/cross_signing_bootstrap.rs b/crates/matrix-sdk/examples/cross_signing_bootstrap.rs index 35ea66654..3247297ee 100644 --- a/crates/matrix-sdk/examples/cross_signing_bootstrap.rs +++ b/crates/matrix-sdk/examples/cross_signing_bootstrap.rs @@ -15,20 +15,18 @@ async fn bootstrap(client: Client, user_id: OwnedUserId, password: String) { io::stdin().read_line(&mut input).expect("error: unable to read user input"); if let Err(e) = client.encryption().bootstrap_cross_signing(None).await { - use matrix_sdk::ruma::{api::client::uiaa, assign}; + use matrix_sdk::ruma::api::client::uiaa; if let Some(response) = e.uiaa_response() { - let auth_data = uiaa::AuthData::Password(assign!( - uiaa::Password::new( - uiaa::UserIdentifier::UserIdOrLocalpart(user_id.as_str()), - &password, - ), - { session: response.session.as_deref() } - )); + let mut password = uiaa::Password::new( + uiaa::UserIdentifier::UserIdOrLocalpart(user_id.as_str()), + &password, + ); + password.session = response.session.as_deref(); client .encryption() - .bootstrap_cross_signing(Some(auth_data)) + .bootstrap_cross_signing(Some(uiaa::AuthData::Password(password))) .await .expect("Couldn't bootstrap cross signing") } else { diff --git a/crates/matrix-sdk/examples/timeline.rs b/crates/matrix-sdk/examples/timeline.rs index 339a7ee93..7cdd77241 100644 --- a/crates/matrix-sdk/examples/timeline.rs +++ b/crates/matrix-sdk/examples/timeline.rs @@ -6,8 +6,7 @@ use matrix_sdk::{ config::SyncSettings, room::Room, ruma::{ - api::client::filter::{FilterDefinition, LazyLoadOptions, RoomEventFilter, RoomFilter}, - assign, + api::client::filter::{FilterDefinition, LazyLoadOptions}, events::{AnySyncMessageLikeEvent, AnySyncRoomEvent, SyncMessageLikeEvent}, }, store::make_store_config, @@ -73,15 +72,10 @@ async fn main() -> anyhow::Result<()> { let client = login(homeserver_url, &username, &password).await; - let room_event_filter = assign!(RoomEventFilter::default(), { - lazy_load_options: LazyLoadOptions::Enabled {include_redundant_members: false}, - }); - let filter = assign!(FilterDefinition::default(), { - room: assign!(RoomFilter::empty(), { - include_leave: true, - state: room_event_filter, - }), - }); + let mut filter = FilterDefinition::default(); + filter.room.include_leave = true; + filter.room.state.lazy_load_options = + LazyLoadOptions::Enabled { include_redundant_members: false }; let sync_settings = SyncSettings::new().timeout(Duration::from_secs(30)).filter(filter.into()); let (sender, receiver) = oneshot::channel::<()>();