Skip to content

Commit 7e5daa8

Browse files
authored
Fix Clippy 1.88 warnings (#334)
## 🎟️ Tracking <!-- Paste the link to the Jira or GitHub issue or otherwise describe / point to where this change is coming from. --> ## 📔 Objective Clippy in Rust 1.88 comes with a warning about uninlined format arguments, this PR just runs `cargo clippy --fix` to resolve them, and also excludes the warning from the generated code in the `bitwarden-api-*` crates. ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes
1 parent 0cc1aed commit 7e5daa8

File tree

31 files changed

+65
-63
lines changed

31 files changed

+65
-63
lines changed

bitwarden_license/bitwarden-sm/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub fn validate_only_whitespaces(value: &str) -> Result<(), validator::Validatio
4747

4848
impl From<ValidationErrors> for ValidationError {
4949
fn from(e: ValidationErrors) -> Self {
50-
debug!("Validation errors: {:#?}", e);
50+
debug!("Validation errors: {e:#?}");
5151
for (field_name, errors) in e.field_errors() {
5252
for error in errors {
5353
match error.code.as_ref() {
@@ -74,7 +74,7 @@ impl From<ValidationErrors> for ValidationError {
7474
}
7575
}
7676
}
77-
ValidationError::Unknown(format!("{:#?}", e))
77+
ValidationError::Unknown(format!("{e:#?}"))
7878
}
7979
}
8080

crates/bitwarden-api-api/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
clippy::too_many_arguments,
44
clippy::empty_docs,
55
clippy::to_string_in_format_args,
6-
clippy::needless_return
6+
clippy::needless_return,
7+
clippy::uninlined_format_args
78
)]
89

910
extern crate reqwest;

crates/bitwarden-api-identity/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
clippy::too_many_arguments,
44
clippy::empty_docs,
55
clippy::to_string_in_format_args,
6-
clippy::needless_return
6+
clippy::needless_return,
7+
clippy::uninlined_format_args
78
)]
89

910
extern crate reqwest;

crates/bitwarden-core/src/auth/api/request/access_token_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl AccessTokenRequest {
2323
client_secret: client_secret.to_string(),
2424
grant_type: "client_credentials".to_string(),
2525
};
26-
debug!("initializing {:?}", obj);
26+
debug!("initializing {obj:?}");
2727
obj
2828
}
2929

crates/bitwarden-core/src/auth/api/request/api_token_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl ApiTokenRequest {
3131
device_name: "firefox".to_string(),
3232
grant_type: "client_credentials".to_string(),
3333
};
34-
debug!("initializing {:?}", obj);
34+
debug!("initializing {obj:?}");
3535
obj
3636
}
3737

crates/bitwarden-core/src/auth/api/request/auth_request_token_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl AuthRequestTokenRequest {
4747
auth_request_id: *auth_request_id,
4848
access_code: access_code.to_string(),
4949
};
50-
debug!("initializing {:?}", obj);
50+
debug!("initializing {obj:?}");
5151
obj
5252
}
5353

crates/bitwarden-core/src/auth/api/request/password_token_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl PasswordTokenRequest {
5656
two_factor_provider: tf.map(|t| t.provider.clone()),
5757
two_factor_remember: tf.map(|t| t.remember),
5858
};
59-
debug!("initializing {:?}", obj);
59+
debug!("initializing {obj:?}");
6060
obj
6161
}
6262

crates/bitwarden-core/src/auth/api/response/identity_token_fail_response.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ impl fmt::Display for IdentityTokenFailResponse {
1717
false => self.error_model.message.clone(),
1818
};
1919

20-
write!(f, "{}", msg)
20+
write!(f, "{msg}")
2121
}
2222
}
2323

crates/bitwarden-core/src/client/internal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl InternalClient {
112112
pub(crate) fn set_login_method(&self, login_method: LoginMethod) {
113113
use log::debug;
114114

115-
debug! {"setting login method: {:#?}", login_method}
115+
debug! {"setting login method: {login_method:#?}"}
116116
*self.login_method.write().expect("RwLock is not poisoned") = Some(Arc::new(login_method));
117117
}
118118

crates/bitwarden-core/src/key_management/crypto.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ pub(super) fn verify_asymmetric_keys(
561561
valid_private_key: true,
562562
},
563563
Err(e) => {
564-
log::debug!("User asymmetric keys verification: {}", e);
564+
log::debug!("User asymmetric keys verification: {e}");
565565

566566
VerifyAsymmetricKeysResponse {
567567
private_key_decryptable: !matches!(e, VerifyError::DecryptFailed(_)),

0 commit comments

Comments
 (0)