diff --git a/keyserver/addons/rust-node-addon/src/identity_client/login.rs b/keyserver/addons/rust-node-addon/src/identity_client/login.rs --- a/keyserver/addons/rust-node-addon/src/identity_client/login.rs +++ b/keyserver/addons/rust-node-addon/src/identity_client/login.rs @@ -9,6 +9,7 @@ #[napi] #[instrument(skip_all)] +#[allow(clippy::too_many_arguments)] pub async fn login_user( username: String, password: String, diff --git a/keyserver/addons/rust-node-addon/src/identity_client/mod.rs b/keyserver/addons/rust-node-addon/src/identity_client/mod.rs --- a/keyserver/addons/rust-node-addon/src/identity_client/mod.rs +++ b/keyserver/addons/rust-node-addon/src/identity_client/mod.rs @@ -212,6 +212,7 @@ use super::CODE_VERSION; #[test] + #[allow(clippy::assertions_on_constants)] fn test_code_version_exists() { assert!(CODE_VERSION > 0); } diff --git a/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs b/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs --- a/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs +++ b/keyserver/addons/rust-node-addon/src/identity_client/register_user.rs @@ -4,6 +4,7 @@ #[napi] #[instrument(skip_all)] +#[allow(clippy::too_many_arguments)] pub async fn register_user( username: String, password: String, diff --git a/native/native_rust_library/src/backup.rs b/native/native_rust_library/src/backup.rs --- a/native/native_rust_library/src/backup.rs +++ b/native/native_rust_library/src/backup.rs @@ -296,10 +296,10 @@ } pub async fn create_siwe_backup_msg_compaction( - backup_id: &String, + backup_id: &str, siwe_backup_msg: String, ) -> Result<(), Box> { - let siwe_backup_msg_file = get_siwe_backup_message_path(&backup_id)?; + let siwe_backup_msg_file = get_siwe_backup_message_path(backup_id)?; tokio::fs::write(siwe_backup_msg_file, siwe_backup_msg).await?; Ok(()) diff --git a/native/native_rust_library/src/identity/login.rs b/native/native_rust_library/src/identity/login.rs --- a/native/native_rust_library/src/identity/login.rs +++ b/native/native_rust_library/src/identity/login.rs @@ -13,6 +13,7 @@ use crate::utils::jsi_callbacks::handle_string_result_as_callback; use crate::{Error, CODE_VERSION, DEVICE_TYPE, IDENTITY_SOCKET_ADDR, RUNTIME}; +#[allow(clippy::too_many_arguments)] pub mod ffi { use crate::identity::{ DeviceKeys, LogInPasswordUserInfo, LogInWalletUserInfo, diff --git a/native/native_rust_library/src/identity/registration.rs b/native/native_rust_library/src/identity/registration.rs --- a/native/native_rust_library/src/identity/registration.rs +++ b/native/native_rust_library/src/identity/registration.rs @@ -19,6 +19,7 @@ RegisterReservedWalletUserInfo, RegisterWalletUserInfo, }; +#[allow(clippy::too_many_arguments)] pub mod ffi { use crate::identity::{ DeviceKeys, RegisterPasswordUserInfo, RegisterReservedPasswordUserInfo, diff --git a/native/native_rust_library/src/identity/x3dh.rs b/native/native_rust_library/src/identity/x3dh.rs --- a/native/native_rust_library/src/identity/x3dh.rs +++ b/native/native_rust_library/src/identity/x3dh.rs @@ -86,6 +86,7 @@ }); } + #[allow(clippy::too_many_arguments)] pub fn refresh_user_prekeys( auth_user_id: String, auth_device_id: String, diff --git a/native/native_rust_library/src/lib.rs b/native/native_rust_library/src/lib.rs --- a/native/native_rust_library/src/lib.rs +++ b/native/native_rust_library/src/lib.rs @@ -41,6 +41,7 @@ use identity::ffi::*; use utils::future_manager::ffi::*; +#[allow(clippy::too_many_arguments)] #[cxx::bridge] mod ffi { diff --git a/services/blob/src/service.rs b/services/blob/src/service.rs --- a/services/blob/src/service.rs +++ b/services/blob/src/service.rs @@ -168,7 +168,7 @@ if let Some(invite_secret) = blob_hash.strip_prefix(INVITE_LINK_BLOB_HASH_PREFIX) { - Self::validate_invite_link_blob_hash(&invite_secret)?; + Self::validate_invite_link_blob_hash(invite_secret)?; } let mut upload_session = diff --git a/services/commtest/src/identity/mod.rs b/services/commtest/src/identity/mod.rs --- a/services/commtest/src/identity/mod.rs +++ b/services/commtest/src/identity/mod.rs @@ -37,7 +37,7 @@ } /// signs message, returns signature - pub fn sign_message(&mut self, message: &str) -> String { + pub fn sign_message(&self, message: &str) -> String { let signature: Signature = self.signing_key.sign(message.as_bytes()); base64::engine::general_purpose::STANDARD_NO_PAD .encode(signature.to_bytes()) diff --git a/services/commtest/tests/identity_access_tokens_tests.rs b/services/commtest/tests/identity_access_tokens_tests.rs --- a/services/commtest/tests/identity_access_tokens_tests.rs +++ b/services/commtest/tests/identity_access_tokens_tests.rs @@ -43,7 +43,7 @@ .await .expect("Couldn't connect to identity service"); - let mut account = SigningCapableAccount::new(); + let account = SigningCapableAccount::new(); let client_keys = account.public_keys(); let user = register_user_device(Some(&client_keys), None).await; diff --git a/services/commtest/tests/identity_one_time_key_tests.rs b/services/commtest/tests/identity_one_time_key_tests.rs --- a/services/commtest/tests/identity_one_time_key_tests.rs +++ b/services/commtest/tests/identity_one_time_key_tests.rs @@ -81,8 +81,8 @@ (0..20).map(|_| generate_random_olm_key()).collect(); if request_num == 0 { - expected_first_retrieved_content_key = content_keys.get(0).cloned(); - expected_first_retrieved_notif_key = notif_keys.get(0).cloned(); + expected_first_retrieved_content_key = content_keys.first().cloned(); + expected_first_retrieved_notif_key = notif_keys.first().cloned(); expected_second_retrieved_content_key = content_keys.get(5).cloned(); expected_second_retrieved_notif_key = notif_keys.get(5).cloned(); } diff --git a/services/identity/src/database.rs b/services/identity/src/database.rs --- a/services/identity/src/database.rs +++ b/services/identity/src/database.rs @@ -207,6 +207,7 @@ Ok(user_id) } + #[allow(clippy::too_many_arguments)] pub async fn add_wallet_user_to_users_table( &self, flattened_device_key_upload: FlattenedDeviceKeyUpload, diff --git a/services/identity/src/grpc_services/authenticated.rs b/services/identity/src/grpc_services/authenticated.rs --- a/services/identity/src/grpc_services/authenticated.rs +++ b/services/identity/src/grpc_services/authenticated.rs @@ -677,6 +677,7 @@ } } +#[allow(dead_code)] enum DeviceListItemKind { Any, Primary, diff --git a/services/identity/src/grpc_services/shared.rs b/services/identity/src/grpc_services/shared.rs --- a/services/identity/src/grpc_services/shared.rs +++ b/services/identity/src/grpc_services/shared.rs @@ -1,6 +1,6 @@ use grpc_clients::error::unsupported_version; -use tonic::{IntoRequest, Request, Status}; -use tracing::{trace, Instrument}; +use tonic::{Request, Status}; +use tracing::trace; use crate::constants::{request_metadata, MIN_SUPPORTED_NATIVE_VERSION}; diff --git a/services/identity/src/regex.rs b/services/identity/src/regex.rs --- a/services/identity/src/regex.rs +++ b/services/identity/src/regex.rs @@ -29,11 +29,13 @@ )); } + #[allow(clippy::bool_assert_comparison)] #[test] fn test_invalid_username_too_short() { assert_eq!(is_valid_username(""), false); } + #[allow(clippy::bool_assert_comparison)] #[test] fn test_invalid_username_too_long() { assert_eq!( @@ -42,11 +44,13 @@ ); } + #[allow(clippy::bool_assert_comparison)] #[test] fn test_invalid_username_first_char_non_alphanumeric() { assert_eq!(is_valid_username("-asdf"), false); } + #[allow(clippy::bool_assert_comparison)] #[test] fn test_invalid_username_invalid_symbol() { assert_eq!(is_valid_username("asdf$"), false); diff --git a/services/identity/src/siwe.rs b/services/identity/src/siwe.rs --- a/services/identity/src/siwe.rs +++ b/services/identity/src/siwe.rs @@ -121,6 +121,7 @@ )); } + #[allow(clippy::bool_assert_comparison)] #[test] fn test_invalid_ethereum_address() { // Shorter than 42 characters diff --git a/shared/comm-lib/src/lib.rs b/shared/comm-lib/src/lib.rs --- a/shared/comm-lib/src/lib.rs +++ b/shared/comm-lib/src/lib.rs @@ -11,6 +11,7 @@ pub mod shared; pub mod tools; +#[allow(unused_imports)] mod reexports { #[cfg(feature = "blob-client")] pub use {bytes, reqwest}; @@ -30,4 +31,6 @@ pub use ddb::Error as DynamoDBError; } } + +#[allow(unused_imports)] pub use reexports::*;