From bd4f8d58efa1f0dd16f01ae86b3c6ebf621404c9 Mon Sep 17 00:00:00 2001 From: Joshua Nelson Date: Wed, 7 Sep 2022 10:16:13 -0500 Subject: [PATCH] Fix clippy warnings --- boring-sys/build.rs | 6 +++--- boring-sys/src/lib.rs | 1 + boring/src/ssl/connector.rs | 4 ++-- boring/src/stack.rs | 4 ++-- boring/src/string.rs | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/boring-sys/build.rs b/boring-sys/build.rs index 3c8a1e21..9bccf945 100644 --- a/boring-sys/build.rs +++ b/boring-sys/build.rs @@ -42,7 +42,7 @@ fn cmake_params_android() -> &'static [(&'static str, &'static str)] { }; for (android_arch, params) in cmake_params_android { if *android_arch == arch { - return *params; + return params; } } &[] @@ -76,7 +76,7 @@ fn cmake_params_ios() -> &'static [(&'static str, &'static str)] { let target = std::env::var("TARGET").unwrap(); for (ios_target, params) in CMAKE_PARAMS_IOS { if *ios_target == target { - return *params; + return params; } } &[] @@ -85,7 +85,7 @@ fn cmake_params_ios() -> &'static [(&'static str, &'static str)] { fn get_ios_sdk_name() -> &'static str { for (name, value) in cmake_params_ios() { if *name == "CMAKE_OSX_SYSROOT" { - return *value; + return value; } } let target = std::env::var("TARGET").unwrap(); diff --git a/boring-sys/src/lib.rs b/boring-sys/src/lib.rs index 6dba54c2..c19461a7 100644 --- a/boring-sys/src/lib.rs +++ b/boring-sys/src/lib.rs @@ -15,6 +15,7 @@ use std::convert::TryInto; use std::ffi::c_void; use std::os::raw::{c_char, c_int, c_uint, c_ulong}; +#[allow(clippy::useless_transmute, clippy::derive_partial_eq_without_eq)] mod generated { include!(concat!(env!("OUT_DIR"), "/bindings.rs")); } diff --git a/boring/src/ssl/connector.rs b/boring/src/ssl/connector.rs index f9287459..1336fafe 100644 --- a/boring/src/ssl/connector.rs +++ b/boring/src/ssl/connector.rs @@ -100,7 +100,7 @@ impl SslConnector { /// Returns a shared reference to the inner raw `SslContext`. pub fn context(&self) -> &SslContextRef { - &*self.0 + &self.0 } } @@ -293,7 +293,7 @@ impl SslAcceptor { /// Returns a shared reference to the inner raw `SslContext`. pub fn context(&self) -> &SslContextRef { - &*self.0 + &self.0 } } diff --git a/boring/src/stack.rs b/boring/src/stack.rs index 5237608e..812bf52d 100644 --- a/boring/src/stack.rs +++ b/boring/src/stack.rs @@ -79,13 +79,13 @@ impl iter::IntoIterator for Stack { impl AsRef> for Stack { fn as_ref(&self) -> &StackRef { - &*self + self } } impl Borrow> for Stack { fn borrow(&self) -> &StackRef { - &*self + self } } diff --git a/boring/src/string.rs b/boring/src/string.rs index 6fca5397..05c401f1 100644 --- a/boring/src/string.rs +++ b/boring/src/string.rs @@ -34,7 +34,7 @@ impl Stackable for OpensslString { impl AsRef for OpensslString { fn as_ref(&self) -> &str { - &**self + self } } @@ -57,7 +57,7 @@ impl Deref for OpensslStringRef { impl AsRef for OpensslStringRef { fn as_ref(&self) -> &str { - &*self + self } }