From a54f18f445e5bb13231ab3c716a32d1706119b5f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 18 Feb 2023 23:55:19 -0500 Subject: more clippy cleanups --- src/api.rs | 3 --- src/bin/rbw-agent/main.rs | 1 + src/bin/rbw-agent/sock.rs | 2 -- src/bin/rbw/commands.rs | 3 --- src/bin/rbw/main.rs | 1 + src/db.rs | 1 - src/lib.rs | 1 + src/pinentry.rs | 1 - src/protocol.rs | 3 --- 9 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/api.rs b/src/api.rs index b6cb4d4..174949d 100644 --- a/src/api.rs +++ b/src/api.rs @@ -678,9 +678,6 @@ impl Client { device_push_token: String::new(), two_factor_token: two_factor_token .map(std::string::ToString::to_string), - // enum casts are safe, and i don't think there's a better way to - // write it without some explicit impls - #[allow(clippy::as_conversions)] two_factor_provider: two_factor_provider.map(|ty| ty as u32), }; let client = self.reqwest_client().await?; diff --git a/src/bin/rbw-agent/main.rs b/src/bin/rbw-agent/main.rs index 8342a36..ad1fe80 100644 --- a/src/bin/rbw-agent/main.rs +++ b/src/bin/rbw-agent/main.rs @@ -11,6 +11,7 @@ #![allow(clippy::too_many_lines)] #![allow(clippy::type_complexity)] #![allow(clippy::multiple_crate_versions)] +#![allow(clippy::large_enum_variant)] use anyhow::Context as _; diff --git a/src/bin/rbw-agent/sock.rs b/src/bin/rbw-agent/sock.rs index b97d33d..280b8cc 100644 --- a/src/bin/rbw-agent/sock.rs +++ b/src/bin/rbw-agent/sock.rs @@ -44,8 +44,6 @@ impl Sock { pub fn listen() -> anyhow::Result { let path = rbw::dirs::socket_file(); // if the socket already doesn't exist, that's fine - // https://github.com/rust-lang/rust-clippy/issues/8003 - #[allow(let_underscore_drop)] let _ = std::fs::remove_file(&path); let sock = tokio::net::UnixListener::bind(&path) .context("failed to listen on socket")?; diff --git a/src/bin/rbw/commands.rs b/src/bin/rbw/commands.rs index a2516d6..93f00da 100644 --- a/src/bin/rbw/commands.rs +++ b/src/bin/rbw/commands.rs @@ -514,7 +514,6 @@ impl DecryptedCipher { #[derive(Debug, Clone)] #[cfg_attr(test, derive(Eq, PartialEq))] -#[allow(clippy::large_enum_variant)] enum DecryptedData { Login { username: Option, @@ -1252,8 +1251,6 @@ fn check_config() -> anyhow::Result<()> { fn version_or_quit() -> anyhow::Result { crate::actions::version().map_err(|e| { - // https://github.com/rust-lang/rust-clippy/issues/8003 - #[allow(let_underscore_drop)] let _ = crate::actions::quit(); e }) diff --git a/src/bin/rbw/main.rs b/src/bin/rbw/main.rs index cd36755..822819a 100644 --- a/src/bin/rbw/main.rs +++ b/src/bin/rbw/main.rs @@ -11,6 +11,7 @@ #![allow(clippy::too_many_lines)] #![allow(clippy::type_complexity)] #![allow(clippy::multiple_crate_versions)] +#![allow(clippy::large_enum_variant)] use anyhow::Context as _; use clap::{CommandFactory as _, Parser as _}; diff --git a/src/db.rs b/src/db.rs index cc9319e..7d09db1 100644 --- a/src/db.rs +++ b/src/db.rs @@ -106,7 +106,6 @@ impl<'de> serde::Deserialize<'de> for Uri { #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq, )] -#[allow(clippy::large_enum_variant)] pub enum EntryData { Login { username: Option, diff --git a/src/lib.rs b/src/lib.rs index eaef000..fd14fcf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -11,6 +11,7 @@ #![allow(clippy::too_many_lines)] #![allow(clippy::type_complexity)] #![allow(clippy::multiple_crate_versions)] +#![allow(clippy::large_enum_variant)] // we aren't really documenting apis anyway #![allow(clippy::missing_errors_doc)] #![allow(clippy::missing_panics_doc)] diff --git a/src/pinentry.rs b/src/pinentry.rs index d3bf65a..f7d36c7 100644 --- a/src/pinentry.rs +++ b/src/pinentry.rs @@ -160,7 +160,6 @@ fn percent_decode(buf: &mut [u8]) -> usize { if c == b'%' && read_idx + 2 < len { if let Some(h) = char::from(buf[read_idx + 1]).to_digit(16) { - #[allow(clippy::cast_possible_truncation)] if let Some(l) = char::from(buf[read_idx + 2]).to_digit(16) { // h and l were parsed from a single hex digit, so they // must be in the range 0-15, so these unwraps are safe diff --git a/src/protocol.rs b/src/protocol.rs index a10d301..f9a9d28 100644 --- a/src/protocol.rs +++ b/src/protocol.rs @@ -1,6 +1,3 @@ -// https://github.com/rust-lang/rust-clippy/issues/6902 -#![allow(clippy::use_self)] - // eventually it would be nice to make this a const function so that we could // just get the version from a variable directly, but this is fine for now #[must_use] -- cgit v1.2.3-54-g00ecf