Skip to content

Commit abda0ca

Browse files
style: use #[expect] instead of #[allow] (#1385)
## 📔 Objective [Rust 1.81 stabilized the `#[expect]` attribute](rust-lang/rust#120924). This attribute acts very similarly to `#[allow]`, in that it allows for the suppression of various style lints. Unlike `#[allow]`, however, it tells the linter to _expect_ that you are overriding a linter warning. If the override is no longer applicable, then `#[expect]` will throw a warning stating that the lint suppression is no longer needed so that you can remove it. ## ⏰ 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 2cc86e4 commit abda0ca

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ schemars = { version = ">=0.8.9, <0.9", features = ["uuid1", "chrono"] }
2929
tokio = { version = "1.36.0", features = ["macros"] }
3030

3131
[workspace.lints.clippy]
32+
allow-attributes = "deny"
3233
unused_async = "deny"
3334
unwrap_used = "deny"
3435

crates/bws/src/cli.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) const UUIDS_AS_KEYNAMES_VAR_NAME: &str = "BWS_UUIDS_AS_KEYNAMES";
1414
pub(crate) const DEFAULT_CONFIG_FILENAME: &str = "config";
1515
pub(crate) const DEFAULT_CONFIG_DIRECTORY: &str = ".config/bws";
1616

17-
#[allow(non_camel_case_types)]
17+
#[expect(non_camel_case_types)]
1818
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)]
1919
pub(crate) enum ProfileKey {
2020
server_base,
@@ -25,7 +25,7 @@ pub(crate) enum ProfileKey {
2525
}
2626

2727
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, ValueEnum, Debug)]
28-
#[allow(clippy::upper_case_acronyms)]
28+
#[expect(clippy::upper_case_acronyms)]
2929
pub(crate) enum Output {
3030
JSON,
3131
YAML,

crates/bws/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ async fn main() -> Result<()> {
2727
process_commands().await
2828
}
2929

30-
#[allow(clippy::comparison_chain)]
3130
async fn process_commands() -> Result<()> {
3231
let cli = Cli::parse();
3332
let color = cli.color;

crates/bws/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ pub(crate) fn uuid_to_posix(uuid: &Uuid) -> String {
2626
format!("_{}", uuid.to_string().replace('-', "_"))
2727
}
2828

29+
#[cfg(test)]
2930
mod tests {
30-
#[allow(unused_imports)]
3131
use super::*;
3232

3333
#[test]

crates/sdk-schemas/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fn write_schema(schema: RootSchema, dir_path: String, type_name: String) -> Resu
8787

8888
use bitwarden_json::response::Response;
8989

90-
#[allow(dead_code)]
90+
#[expect(dead_code)]
9191
#[derive(JsonSchema)]
9292
struct SchemaTypes {
9393
// Input types for new Client

0 commit comments

Comments
 (0)