chore: make clippy happy

This commit is contained in:
Benjamin Bouvier
2023-10-20 12:50:07 +02:00
parent 456472af6c
commit e1feefcbb0
4 changed files with 11 additions and 7 deletions

View File

@@ -105,6 +105,7 @@ impl ClientBuilder {
server_versions: None,
handle_refresh_tokens: false,
base_client: None,
#[cfg(feature = "e2e-encryption")]
encryption_settings: Default::default(),
}
}

View File

@@ -72,7 +72,6 @@ use crate::{
authentication::{AuthCtx, AuthData, ReloadSessionCallback, SaveSessionCallback},
config::RequestConfig,
deduplicating_handler::DeduplicatingHandler,
encryption::EncryptionSettings,
error::{HttpError, HttpResult},
event_handler::{
EventHandler, EventHandlerDropGuard, EventHandlerHandle, EventHandlerStore, SyncEvent,
@@ -85,7 +84,10 @@ use crate::{
TransmissionProgress,
};
#[cfg(feature = "e2e-encryption")]
use crate::{encryption::Encryption, store_locks::CrossProcessStoreLock};
use crate::{
encryption::{Encryption, EncryptionSettings},
store_locks::CrossProcessStoreLock,
};
mod builder;
mod futures;
@@ -1921,7 +1923,7 @@ impl Client {
self.inner.server_versions.get().cloned(),
self.inner.respect_login_well_known,
#[cfg(feature = "e2e-encryption")]
self.inner.encryption_settings.clone(),
self.inner.encryption_settings,
)),
};

View File

@@ -20,10 +20,7 @@ use std::{
};
use ruma::{
api::client::{
session::login,
uiaa::{AuthData, Password, RegistrationToken, UserIdentifier},
},
api::client::{session::login, uiaa::UserIdentifier},
assign,
serde::JsonObject,
};
@@ -192,6 +189,8 @@ impl LoginBuilder {
// TODO: (#2763) put this into a background task.
#[cfg(feature = "e2e-encryption")]
if self.auth.client.encryption().settings().auto_enable_cross_signing {
use ruma::api::client::uiaa::{AuthData, Password};
let auth_data = match login_info {
login::v3::LoginInfo::Password(p) => {
Some(AuthData::Password(Password::new(p.identifier, p.password)))

View File

@@ -324,6 +324,7 @@ fn test_serialize_session() {
);
}
#[cfg(feature = "e2e-encryption")]
#[async_test]
async fn test_login_with_cross_signing_bootstrapping() {
let server = MockServer::start().await;
@@ -500,6 +501,7 @@ async fn test_login_with_cross_signing_bootstrapping() {
}
}
#[cfg(feature = "e2e-encryption")]
#[async_test]
async fn test_login_with_cross_signing_bootstrapping_already_bootstrapped() {
// Even if we enabled cross-signing bootstrap for another device, it won't