From ffb4c6d6ef7b2e78e2c004c0c3dc7c3199dba03c Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Fri, 29 Jul 2022 15:24:21 +0200 Subject: [PATCH] docs: Use new ClientBuilder methods in examples --- crates/matrix-sdk/examples/autojoin.rs | 9 +++------ crates/matrix-sdk/examples/command_bot.rs | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/crates/matrix-sdk/examples/autojoin.rs b/crates/matrix-sdk/examples/autojoin.rs index 9d031a601..a047f246e 100644 --- a/crates/matrix-sdk/examples/autojoin.rs +++ b/crates/matrix-sdk/examples/autojoin.rs @@ -47,16 +47,13 @@ async fn login_and_sync( #[cfg(feature = "sled")] { // The location to save files to - let mut home = dirs::home_dir().expect("no home directory found"); - home.push("autojoin_bot"); - let state_store = matrix_sdk_sled::StateStore::builder().path(home).build()?; - client_builder = client_builder.state_store(state_store); + let home = dirs::home_dir().expect("no home directory found").join("autojoin_bot"); + client_builder = client_builder.sled_store(home, None)?; } #[cfg(feature = "indexeddb")] { - let state_store = matrix_sdk_indexeddb::StateStore::builder().build()?; - client_builder = client_builder.state_store(state_store); + client_builder = client_builder.indexeddb_store("autojoin_bot", None).await?; } let client = client_builder.build().await?; diff --git a/crates/matrix-sdk/examples/command_bot.rs b/crates/matrix-sdk/examples/command_bot.rs index 6b6b855e4..ea0ebfa7a 100644 --- a/crates/matrix-sdk/examples/command_bot.rs +++ b/crates/matrix-sdk/examples/command_bot.rs @@ -42,16 +42,13 @@ async fn login_and_sync( #[cfg(feature = "sled")] { // The location to save files to - let mut home = dirs::home_dir().expect("no home directory found"); - home.push("party_bot"); - let state_store = matrix_sdk_sled::StateStore::builder().path(home).build()?; - client_builder = client_builder.state_store(state_store); + let home = dirs::home_dir().expect("no home directory found").join("party_bot"); + client_builder = client_builder.sled_store(home, None)?; } #[cfg(feature = "indexeddb")] { - let state_store = matrix_sdk_indexeddb::StateStore::builder().build().await?; - client_builder = client_builder.state_store(state_store); + client_builder = client_builder.indexeddb_store("party_bot", None).await?; } let client = client_builder.build().await.unwrap();