diff --git a/crates/matrix-sdk/examples/autojoin.rs b/crates/matrix-sdk/examples/autojoin.rs index 4968f638e..5f7296278 100644 --- a/crates/matrix-sdk/examples/autojoin.rs +++ b/crates/matrix-sdk/examples/autojoin.rs @@ -49,13 +49,13 @@ async fn login_and_sync( // 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::open_with_path(home)?; + let state_store = matrix_sdk_sled::SledStateStoreBuilder::default().path(home).build()?; client_builder = client_builder.state_store(state_store); } #[cfg(feature = "indexeddb")] { - let state_store = matrix_sdk_indexeddb::StateStore::open(); + let state_store = matrix_sdk_indexeddb::StateStoreBuilder::default().build()?; client_builder = client_builder.state_store(state_store); } diff --git a/crates/matrix-sdk/examples/command_bot.rs b/crates/matrix-sdk/examples/command_bot.rs index 7308f02dc..e49b2381c 100644 --- a/crates/matrix-sdk/examples/command_bot.rs +++ b/crates/matrix-sdk/examples/command_bot.rs @@ -44,13 +44,13 @@ async fn login_and_sync( // 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::open_with_path(home)?; + let state_store = matrix_sdk_sled::SledStateStoreBuilder::default().path(home).build()?; client_builder = client_builder.state_store(state_store); } #[cfg(feature = "indexeddb")] { - let state_store = matrix_sdk_indexeddb::StateStore::open(); + let state_store = matrix_sdk_indexeddb::StateStoreBuilder::default().build().await?; client_builder = client_builder.state_store(state_store); } diff --git a/labs/sled-state-inspector/src/main.rs b/labs/sled-state-inspector/src/main.rs index 2785345c3..cf8db8d1a 100644 --- a/labs/sled-state-inspector/src/main.rs +++ b/labs/sled-state-inspector/src/main.rs @@ -4,7 +4,7 @@ use atty::Stream; use clap::{Arg, ArgMatches, Command as Argparse}; use futures::executor::block_on; use matrix_sdk_base::RoomInfo; -use matrix_sdk_sled::StateStore; +use matrix_sdk_sled::{SledStateStoreBuilder, StateStore}; use ruma::{events::StateEventType, OwnedRoomId, OwnedUserId, RoomId}; use rustyline::{ completion::{Completer, Pair}, @@ -202,8 +202,12 @@ impl Printer { impl Inspector { fn new(database_path: &str, json: bool, color: bool) -> Self { let printer = Printer::new(json, color); - let store = - Arc::new(StateStore::open_with_path(database_path).expect("Can't open sled database")); + let store = Arc::new( + SledStateStoreBuilder::default() + .path(database_path.into()) + .build() + .expect("Can't open sled database"), + ); Self { store, printer } }