diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 04b28ed25..d6e57740e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -49,6 +49,6 @@ jobs: RUSTDOCFLAGS: "-D warnings" - name: Cargo clippy - run: cargo clippy --all-features + run: cargo clippy --all-features --tests env: RUSTFLAGS: "-D warnings" diff --git a/crates/bitwarden/src/auth/api/response/identity_payload_response.rs b/crates/bitwarden/src/auth/api/response/identity_payload_response.rs index b35b398d7..47543510b 100644 --- a/crates/bitwarden/src/auth/api/response/identity_payload_response.rs +++ b/crates/bitwarden/src/auth/api/response/identity_payload_response.rs @@ -1,6 +1,7 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, PartialEq)] +#[cfg_attr(test, derive(Default))] pub struct IdentityTokenPayloadResponse { pub access_token: String, pub expires_in: u64, @@ -10,21 +11,3 @@ pub struct IdentityTokenPayloadResponse { pub(crate) encrypted_payload: String, } - -#[cfg(test)] -mod test { - use super::*; - - impl Default for IdentityTokenPayloadResponse { - fn default() -> Self { - Self { - access_token: Default::default(), - expires_in: Default::default(), - refresh_token: Default::default(), - token_type: Default::default(), - scope: Default::default(), - encrypted_payload: Default::default(), - } - } - } -} diff --git a/crates/bitwarden/src/auth/api/response/identity_refresh_response.rs b/crates/bitwarden/src/auth/api/response/identity_refresh_response.rs index eaf5c142f..c5733bd36 100644 --- a/crates/bitwarden/src/auth/api/response/identity_refresh_response.rs +++ b/crates/bitwarden/src/auth/api/response/identity_refresh_response.rs @@ -1,6 +1,7 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Debug, PartialEq)] +#[cfg_attr(test, derive(Default))] pub struct IdentityTokenRefreshResponse { pub access_token: String, pub expires_in: u64, @@ -8,20 +9,3 @@ pub struct IdentityTokenRefreshResponse { token_type: String, scope: String, } - -#[cfg(test)] -mod test { - use super::*; - - impl Default for IdentityTokenRefreshResponse { - fn default() -> Self { - Self { - access_token: Default::default(), - expires_in: Default::default(), - refresh_token: Default::default(), - token_type: Default::default(), - scope: Default::default(), - } - } - } -} diff --git a/crates/bitwarden/src/auth/api/response/identity_token_response.rs b/crates/bitwarden/src/auth/api/response/identity_token_response.rs index ae6cc81e5..b22263bc5 100644 --- a/crates/bitwarden/src/auth/api/response/identity_token_response.rs +++ b/crates/bitwarden/src/auth/api/response/identity_token_response.rs @@ -57,7 +57,7 @@ mod test { #[test] fn two_factor() { - let expected = Box::new(IdentityTwoFactorResponse::default()); + let expected = Box::::default(); let two_factor = serde_json::to_string(&expected).unwrap(); let expected = IdentityTokenResponse::TwoFactorRequired(expected); let actual = parse_identity_response(StatusCode::BAD_REQUEST, two_factor).unwrap(); diff --git a/crates/bitwarden/src/vault/send.rs b/crates/bitwarden/src/vault/send.rs index 5c463a0cf..3aec03639 100644 --- a/crates/bitwarden/src/vault/send.rs +++ b/crates/bitwarden/src/vault/send.rs @@ -280,7 +280,7 @@ mod tests { iterations: 345123.try_into().unwrap(), }, }, - "asdfasdfasdf".into(), + "asdfasdfasdf", "2.majkL1/hNz9yptLqNAUSnw==|RiOzMTTJMG948qu8O3Zm1EQUO2E8BuTwFKnO9LWQjMzxMWJM5GbyOq2/A+tumPbTERt4JWur/FKfgHb+gXuYiEYlXPMuVBvT7nv4LPytJuM=|IVqMxHJeR1ZXY0sGngTC0x+WqbG8p6V+BTrdgBbQXjM=".parse().unwrap(), "2.kmLY8NJVuiKBFJtNd/ZFpA==|qOodlRXER+9ogCe3yOibRHmUcSNvjSKhdDuztLlucs10jLiNoVVVAc+9KfNErLSpx5wmUF1hBOJM8zwVPjgQTrmnNf/wuDpwiaCxNYb/0v4FygPy7ccAHK94xP1lfqq7U9+tv+/yiZSwgcT+xF0wFpoxQeNdNRFzPTuD9o4134n8bzacD9DV/WjcrXfRjbBCzzuUGj1e78+A7BWN7/5IWLz87KWk8G7O/W4+8PtEzlwkru6Wd1xO19GYU18oArCWCNoegSmcGn7w7NDEXlwD403oY8Oa7ylnbqGE28PVJx+HL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