mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-18 21:52:30 -04:00
docs: Use new ClientBuilder methods in examples
This commit is contained in:
committed by
Jonas Platte
parent
93c4c5d128
commit
ffb4c6d6ef
@@ -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?;
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user