Suppress some clippy lints

This commit is contained in:
Dirkjan Ochtman 2021-04-07 16:37:32 +02:00
parent b0486853c6
commit af7d547948
6 changed files with 23 additions and 1 deletions

View File

@ -40,6 +40,7 @@ impl From<webpki::TrustAnchor<'_>> for OwnedTrustAnchor {
}
}
#[allow(clippy::from_over_into)]
impl<'a> Into<webpki::TrustAnchor<'a>> for &'a OwnedTrustAnchor {
fn into(self) -> webpki::TrustAnchor<'a> {
self.to_trust_anchor()

View File

@ -1055,6 +1055,7 @@ struct ExpectTraffic {
}
impl ExpectTraffic {
#[allow(clippy::unnecessary_wraps)] // returns Err for #[cfg(feature = "quic")]
fn handle_new_ticket_tls13(
&mut self,
sess: &mut ClientSession,

View File

@ -214,7 +214,20 @@
// Relax these clippy lints:
// - ptr_arg: this triggers on references to type aliases that are Vec
// underneath.
#![cfg_attr(feature = "cargo-clippy", allow(clippy::ptr_arg))]
// - too_many_arguments: some things just need a lot of state, wrapping it
// doesn't necessarily make it easier to follow what's going on
// - new_ret_no_self: we sometimes return `Arc<Self>`, which seems fine
// - single_component_path_imports: our top-level `use log` import causes
// a false positive, https://github.com/rust-lang/rust-clippy/issues/5210
// - new_without_default: for internal constructors, the indirection is not
// helpful
#![allow(
clippy::too_many_arguments,
clippy::new_ret_no_self,
clippy::ptr_arg,
clippy::single_component_path_imports,
clippy::new_without_default
)]
// Enable documentation for all features on docs.rs
#![cfg_attr(docsrs, feature(doc_cfg))]
@ -353,14 +366,17 @@ pub use crate::verify::{
/// This is the rustls manual.
pub mod manual;
#[allow(clippy::upper_case_acronyms)]
#[doc(hidden)]
#[deprecated(since = "0.20.0", note = "Use ResolvesServerCertUsingSni")]
pub type ResolvesServerCertUsingSNI = ResolvesServerCertUsingSni;
#[allow(clippy::upper_case_acronyms)]
#[cfg(feature = "dangerous_configuration")]
#[cfg_attr(docsrs, doc(cfg(feature = "dangerous_configuration")))]
#[doc(hidden)]
#[deprecated(since = "0.20.0", note = "Use WebPkiVerifier")]
pub type WebPKIVerifier = WebPkiVerifier;
#[allow(clippy::upper_case_acronyms)]
#[doc(hidden)]
#[deprecated(since = "0.20.0", note = "Use TlsError")]
pub type TLSError = Error;

View File

@ -120,6 +120,7 @@ impl u24 {
}
}
#[allow(clippy::from_over_into)]
#[cfg(any(target_pointer_width = "32", target_pointer_width = "64"))]
impl Into<usize> for u24 {
#[inline]

View File

@ -107,6 +107,7 @@ impl MessageDeframer {
}
}
#[allow(clippy::comparison_chain)]
fn buf_consume(&mut self, taken: usize) {
if taken < self.used {
/* Before:

View File

@ -1,3 +1,5 @@
#![allow(clippy::upper_case_acronyms)]
#[macro_use]
mod macros;