From 27c76208f5470651d46f77e16bb2e1b1c14f3a08 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Wed, 29 Sep 2021 09:24:51 +0300 Subject: Allow short single-character argument and variable names Generally speaking, single-character names are not great for the person reading the code later. They don't usually act as a cognitive aid to understand the code. However, this in code implementing cryptographic operations that implements mathematical formulas that canonically use single-letter names it's clearer to use the same name in the code. Thus, I only tell clippy those names are OK in these cases. Found by clippy lint many_single_char_names: https://rust-lang.github.io/rust-clippy/master/index.html#many_single_char_names --- openpgp/src/crypto/backend/nettle/asymmetric.rs | 1 + openpgp/src/serialize/stream/padding.rs | 1 + 2 files changed, 2 insertions(+) (limited to 'openpgp') diff --git a/openpgp/src/crypto/backend/nettle/asymmetric.rs b/openpgp/src/crypto/backend/nettle/asymmetric.rs index 71e9dfe3..bf1126e6 100644 --- a/openpgp/src/crypto/backend/nettle/asymmetric.rs +++ b/openpgp/src/crypto/backend/nettle/asymmetric.rs @@ -386,6 +386,7 @@ impl Key4 /// The RSA key will use public exponent `e` and modulo `n`. The key will /// have it's creation date set to `ctime` or the current time if `None` /// is given. + #[allow(clippy::many_single_char_names)] pub fn import_secret_rsa(d: &[u8], p: &[u8], q: &[u8], ctime: T) -> Result where T: Into> { diff --git a/openpgp/src/serialize/stream/padding.rs b/openpgp/src/serialize/stream/padding.rs index 6fa15f41..38ab804b 100644 --- a/openpgp/src/serialize/stream/padding.rs +++ b/openpgp/src/serialize/stream/padding.rs @@ -363,6 +363,7 @@ impl<'a> writer::Stackable<'a, Cookie> for Padder<'a> /// [example]. /// /// [example]: Padder#examples +#[allow(clippy::many_single_char_names)] pub fn padme(l: u64) -> u64 { if l < 2 { return 1; // Avoid cornercase. -- cgit v1.2.3