mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-15 03:25:46 -04:00
docs(sled): fixing examples and utils
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user