chore(sdk): Remove useless imports or fix unused code.

This commit is contained in:
Ivan Enderlin
2024-02-22 08:27:54 +01:00
committed by Benjamin Bouvier
parent 6593e32582
commit b5bda577dd
4 changed files with 16 additions and 23 deletions

View File

@@ -17,7 +17,6 @@ use std::{
ops::DerefMut,
};
use bs58;
use ruma::api::client::backup::EncryptedSessionData;
use thiserror::Error;
use vodozemac::Curve25519PublicKey;

View File

@@ -862,13 +862,13 @@ pub(crate) mod tests {
// When building a client with the server's URL.
builder = builder.server_name_or_homeserver_url(homeserver.uri());
let client = builder.build().await.unwrap();
let _client = builder.build().await.unwrap();
// Then a client should be built without support for sliding sync or OIDC.
#[cfg(feature = "experimental-sliding-sync")]
assert!(client.sliding_sync_proxy().is_none());
assert!(_client.sliding_sync_proxy().is_none());
#[cfg(feature = "experimental-oidc")]
assert!(client.oidc().authentication_server_info().is_none());
assert!(_client.oidc().authentication_server_info().is_none());
}
#[async_test]
@@ -884,13 +884,13 @@ pub(crate) mod tests {
// When building a client with the server's URL.
builder = builder.server_name_or_homeserver_url(homeserver.uri());
let client = builder.build().await.unwrap();
let _client = builder.build().await.unwrap();
// Then a client should be built with support for sliding sync.
#[cfg(feature = "experimental-sliding-sync")]
assert_eq!(client.sliding_sync_proxy(), Some("https://localhost:1234".parse().unwrap()));
assert_eq!(_client.sliding_sync_proxy(), Some("https://localhost:1234".parse().unwrap()));
#[cfg(feature = "experimental-oidc")]
assert!(client.oidc().authentication_server_info().is_none());
assert!(_client.oidc().authentication_server_info().is_none());
}
#[async_test]
@@ -939,13 +939,13 @@ pub(crate) mod tests {
// When building a client with the base server.
builder = builder.server_name_or_homeserver_url(server.uri());
let client = builder.build().await.unwrap();
let _client = builder.build().await.unwrap();
// Then a client should be built without support for sliding sync or OIDC.
#[cfg(feature = "experimental-sliding-sync")]
assert!(client.sliding_sync_proxy().is_none());
assert!(_client.sliding_sync_proxy().is_none());
#[cfg(feature = "experimental-oidc")]
assert!(client.oidc().authentication_server_info().is_none());
assert!(_client.oidc().authentication_server_info().is_none());
}
#[async_test]
@@ -968,13 +968,13 @@ pub(crate) mod tests {
// When building a client with the base server.
builder = builder.server_name_or_homeserver_url(server.uri());
let client = builder.build().await.unwrap();
let _client = builder.build().await.unwrap();
// Then a client should be built with support for sliding sync.
#[cfg(feature = "experimental-sliding-sync")]
assert_eq!(client.sliding_sync_proxy(), Some("https://localhost:1234".parse().unwrap()));
assert_eq!(_client.sliding_sync_proxy(), Some("https://localhost:1234".parse().unwrap()));
#[cfg(feature = "experimental-oidc")]
assert!(client.oidc().authentication_server_info().is_none());
assert!(_client.oidc().authentication_server_info().is_none());
}
#[async_test]
@@ -1030,14 +1030,14 @@ pub(crate) mod tests {
// When building a client with the base server.
builder = builder.server_name_or_homeserver_url(server.uri());
let client = builder.build().await.unwrap();
let _client = builder.build().await.unwrap();
// Then a client should be built with support for both sliding sync and OIDC.
#[cfg(feature = "experimental-sliding-sync")]
assert_eq!(client.sliding_sync_proxy(), Some("https://localhost:1234".parse().unwrap()));
assert_eq!(_client.sliding_sync_proxy(), Some("https://localhost:1234".parse().unwrap()));
#[cfg(feature = "experimental-oidc")]
assert_eq!(
client.oidc().authentication_server_info().unwrap().issuer,
_client.oidc().authentication_server_info().unwrap().issuer,
"https://localhost:5678".to_owned()
);
}

View File

@@ -25,8 +25,6 @@ use eyeball::SharedObservable;
use futures_util::future::try_join;
pub use matrix_sdk_base::media::*;
use mime::Mime;
#[cfg(not(target_arch = "wasm32"))]
use mime2ext;
use ruma::{
api::client::media::{create_content, get_content, get_content_thumbnail},
assign,

View File

@@ -199,11 +199,7 @@ pub fn power_level_user_changes(
mod tests {
use std::collections::BTreeMap;
use ruma::{
events::room::power_levels::{RoomPowerLevels, RoomPowerLevelsEventContent},
int,
power_levels::NotificationPowerLevels,
};
use ruma::{int, power_levels::NotificationPowerLevels};
use super::*;