From 4b1e0661dc602ddee651796de6320650c3f6869b Mon Sep 17 00:00:00 2001 From: Martin Hoffmann Date: Fri, 17 Nov 2023 15:12:46 +0100 Subject: [PATCH] Apply Clippy-suggested fixes. --- src/ca/publication.rs | 4 ++-- src/crypto/keys.rs | 3 ++- src/repository/crl.rs | 1 + src/repository/manifest.rs | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ca/publication.rs b/src/ca/publication.rs index 4c6cfca..7f2461d 100644 --- a/src/ca/publication.rs +++ b/src/ca/publication.rs @@ -335,7 +335,7 @@ impl Query { } } - if pdus.get(0) == Some(&QueryPdu::List) { + if pdus.first() == Some(&QueryPdu::List) { Ok(Query::List) } else { let mut delta = PublishDelta::default(); @@ -974,7 +974,7 @@ impl Reply { pdu_element.take_end(reader)?; } - let reply_kind = match pdus.get(0) { + let reply_kind = match pdus.first() { Some(el) => el.kind(), None => ReplyPduType::List }; diff --git a/src/crypto/keys.rs b/src/crypto/keys.rs index 1dd13d4..ad7e366 100644 --- a/src/crypto/keys.rs +++ b/src/crypto/keys.rs @@ -14,7 +14,8 @@ use ring::error::Unspecified; use ring::signature::VerificationAlgorithm; use untrusted::Input; use crate::oid; -use crate::util::{base64, hex}; +#[cfg(feature = "serde")] use crate::util::base64; +use crate::util::hex; use super::signature::{RpkiSignatureAlgorithm, Signature, SignatureAlgorithm}; diff --git a/src/repository/crl.rs b/src/repository/crl.rs index 19e0d0e..f238004 100644 --- a/src/repository/crl.rs +++ b/src/repository/crl.rs @@ -593,6 +593,7 @@ pub struct RevokedCertificatesIter(Captured); impl Iterator for RevokedCertificatesIter { type Item = CrlEntry; + #[allow(clippy::redundant_closure)] fn next(&mut self) -> Option { self.0.decode_partial(|cons| CrlEntry::take_opt_from(cons)).unwrap() } diff --git a/src/repository/manifest.rs b/src/repository/manifest.rs index 163d3d6..02b510a 100644 --- a/src/repository/manifest.rs +++ b/src/repository/manifest.rs @@ -42,6 +42,7 @@ pub struct Manifest { impl Manifest { /// Decodes a manifest from a source. + #[allow(clippy::redundant_closure)] pub fn decode( source: S, strict: bool