diff --git a/crates/matrix-sdk-base/src/client.rs b/crates/matrix-sdk-base/src/client.rs index 6d824657f..13eaa1852 100644 --- a/crates/matrix-sdk-base/src/client.rs +++ b/crates/matrix-sdk-base/src/client.rs @@ -87,7 +87,9 @@ pub struct BaseClient { olm: Arc>>, #[cfg(feature = "encryption")] cryptostore: Arc>>>, + #[cfg(feature = "encryption")] store_path: Arc>, + #[cfg(feature = "sled_cryptostore")] store_passphrase: Arc>>, } @@ -185,6 +187,12 @@ impl BaseClient { /// * `config` - An optional session if the user already has one from a /// previous login call. pub fn new_with_config(config: BaseClientConfig) -> Result { + #[cfg_attr( + not(any(feature = "sled_state_store", feature = "sled_cryptostore")), + allow(unused_variables) + )] + let config = config; + #[cfg(feature = "sled_state_store")] let stores = if let Some(path) = &config.store_path { if config.passphrase.is_some() { @@ -232,7 +240,9 @@ impl BaseClient { olm: Mutex::new(None).into(), #[cfg(feature = "encryption")] cryptostore: Mutex::new(crypto_store).into(), + #[cfg(feature = "encryption")] store_path: config.store_path.into(), + #[cfg(feature = "sled_cryptostore")] store_passphrase: config.passphrase.into(), }) } diff --git a/crates/matrix-sdk/examples/get_profiles.rs b/crates/matrix-sdk/examples/get_profiles.rs index edbfcb1c3..e2612371b 100644 --- a/crates/matrix-sdk/examples/get_profiles.rs +++ b/crates/matrix-sdk/examples/get_profiles.rs @@ -7,6 +7,7 @@ use matrix_sdk::{ use url::Url; #[derive(Debug)] +#[allow(dead_code)] struct UserProfile { avatar_url: Option, displayname: Option,