Fix clippy warnings

This commit is contained in:
Joshua Nelson 2022-09-07 10:16:13 -05:00 committed by Joshua Nelson
parent 774e721ad9
commit bd4f8d58ef
5 changed files with 10 additions and 9 deletions

View File

@ -42,7 +42,7 @@ fn cmake_params_android() -> &'static [(&'static str, &'static str)] {
}; };
for (android_arch, params) in cmake_params_android { for (android_arch, params) in cmake_params_android {
if *android_arch == arch { 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(); let target = std::env::var("TARGET").unwrap();
for (ios_target, params) in CMAKE_PARAMS_IOS { for (ios_target, params) in CMAKE_PARAMS_IOS {
if *ios_target == target { 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 { fn get_ios_sdk_name() -> &'static str {
for (name, value) in cmake_params_ios() { for (name, value) in cmake_params_ios() {
if *name == "CMAKE_OSX_SYSROOT" { if *name == "CMAKE_OSX_SYSROOT" {
return *value; return value;
} }
} }
let target = std::env::var("TARGET").unwrap(); let target = std::env::var("TARGET").unwrap();

View File

@ -15,6 +15,7 @@ use std::convert::TryInto;
use std::ffi::c_void; use std::ffi::c_void;
use std::os::raw::{c_char, c_int, c_uint, c_ulong}; use std::os::raw::{c_char, c_int, c_uint, c_ulong};
#[allow(clippy::useless_transmute, clippy::derive_partial_eq_without_eq)]
mod generated { mod generated {
include!(concat!(env!("OUT_DIR"), "/bindings.rs")); include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
} }

View File

@ -100,7 +100,7 @@ impl SslConnector {
/// Returns a shared reference to the inner raw `SslContext`. /// Returns a shared reference to the inner raw `SslContext`.
pub fn context(&self) -> &SslContextRef { pub fn context(&self) -> &SslContextRef {
&*self.0 &self.0
} }
} }
@ -293,7 +293,7 @@ impl SslAcceptor {
/// Returns a shared reference to the inner raw `SslContext`. /// Returns a shared reference to the inner raw `SslContext`.
pub fn context(&self) -> &SslContextRef { pub fn context(&self) -> &SslContextRef {
&*self.0 &self.0
} }
} }

View File

@ -79,13 +79,13 @@ impl<T: Stackable> iter::IntoIterator for Stack<T> {
impl<T: Stackable> AsRef<StackRef<T>> for Stack<T> { impl<T: Stackable> AsRef<StackRef<T>> for Stack<T> {
fn as_ref(&self) -> &StackRef<T> { fn as_ref(&self) -> &StackRef<T> {
&*self self
} }
} }
impl<T: Stackable> Borrow<StackRef<T>> for Stack<T> { impl<T: Stackable> Borrow<StackRef<T>> for Stack<T> {
fn borrow(&self) -> &StackRef<T> { fn borrow(&self) -> &StackRef<T> {
&*self self
} }
} }

View File

@ -34,7 +34,7 @@ impl Stackable for OpensslString {
impl AsRef<str> for OpensslString { impl AsRef<str> for OpensslString {
fn as_ref(&self) -> &str { fn as_ref(&self) -> &str {
&**self self
} }
} }
@ -57,7 +57,7 @@ impl Deref for OpensslStringRef {
impl AsRef<str> for OpensslStringRef { impl AsRef<str> for OpensslStringRef {
fn as_ref(&self) -> &str { fn as_ref(&self) -> &str {
&*self self
} }
} }