Fix new (Nightly) Clippy warnings

This commit is contained in:
Jonas Platte
2021-09-21 13:11:53 +02:00
parent 0817bc490e
commit d0851c8a9e
2 changed files with 11 additions and 0 deletions

View File

@@ -87,7 +87,9 @@ pub struct BaseClient {
olm: Arc<Mutex<Option<OlmMachine>>>,
#[cfg(feature = "encryption")]
cryptostore: Arc<Mutex<Option<Box<dyn CryptoStore>>>>,
#[cfg(feature = "encryption")]
store_path: Arc<Option<PathBuf>>,
#[cfg(feature = "sled_cryptostore")]
store_passphrase: Arc<Option<Zeroizing<String>>>,
}
@@ -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<Self> {
#[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(),
})
}

View File

@@ -7,6 +7,7 @@ use matrix_sdk::{
use url::Url;
#[derive(Debug)]
#[allow(dead_code)]
struct UserProfile {
avatar_url: Option<MxcUri>,
displayname: Option<String>,