From 277ffdae09237446400187d939fa5b3fae31b477 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Tue, 21 Jan 2025 13:24:27 -0700 Subject: [PATCH] x-wing: move lint configuration to lib.rs This is more consistent with the rest of the projects in the @RustCrypto organization --- ml-kem/src/lib.rs | 4 ++-- x-wing/Cargo.toml | 7 ------- x-wing/src/lib.rs | 3 +++ 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ml-kem/src/lib.rs b/ml-kem/src/lib.rs index 5feb4ab..61e6f8a 100644 --- a/ml-kem/src/lib.rs +++ b/ml-kem/src/lib.rs @@ -5,11 +5,11 @@ html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] -#![warn(clippy::pedantic)] // Be pedantic by default -#![warn(clippy::integer_division_remainder_used)] // Be judicious about using `/` and `%` #![allow(non_snake_case)] // Allow notation matching the spec #![allow(clippy::clone_on_copy)] // Be explicit about moving data #![deny(missing_docs)] // Require all public interfaces to be documented +#![warn(clippy::pedantic)] // Be pedantic by default +#![warn(clippy::integer_division_remainder_used)] // Be judicious about using `/` and `%` //! # Usage //! diff --git a/x-wing/Cargo.toml b/x-wing/Cargo.toml index 502173d..2accb23 100644 --- a/x-wing/Cargo.toml +++ b/x-wing/Cargo.toml @@ -18,13 +18,6 @@ exclude = ["src/test-vectors.json"] getrandom = ["rand_core/getrandom"] zeroize = ["dep:zeroize", "ml-kem/zeroize", "x25519-dalek/zeroize"] -[lints.clippy] -pedantic = "warn" # Be pedantic by default -similar_names = { level = "allow", priority = 1 } # So we can use the names as in the RFC - -[lints.rust] -missing_docs = "deny" # Require all public interfaces to be documented - [dependencies] rand_core = { version = "0.6", default-features = false } x25519-dalek = { version = "2.0", default-features = false, features = ["static_secrets"] } diff --git a/x-wing/src/lib.rs b/x-wing/src/lib.rs index 7284315..c60316e 100644 --- a/x-wing/src/lib.rs +++ b/x-wing/src/lib.rs @@ -5,6 +5,8 @@ html_logo_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg", html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/meta/master/logo.svg" )] +#![deny(missing_docs)] +#![warn(clippy::pedantic)] //! # Usage //! @@ -133,6 +135,7 @@ pub struct DecapsulationKey { impl Decapsulate for DecapsulationKey { type Error = Infallible; + #[allow(clippy::similar_names)] // So we can use the names as in the RFC fn decapsulate(&self, ct: &Ciphertext) -> Result { let (sk_m, sk_x, _pk_m, pk_x) = self.expand_key(); let ss_m = sk_m.decapsulate(&ct.ct_m)?;