From cde4709f1ee3df9ed7cca56151b2c3b9641ccf48 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Mon, 15 Aug 2022 14:28:35 -0700 Subject: [PATCH 1/7] Fixing cargo clippy complaints --- bindings/rust/generate/src/main.rs | 8 ++++---- bindings/rust/s2n-tls/src/config.rs | 2 +- bindings/rust/s2n-tls/src/enums.rs | 12 ++++++------ bindings/rust/s2n-tls/src/error.rs | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bindings/rust/generate/src/main.rs b/bindings/rust/generate/src/main.rs index 3f58ba2a845..12013fa980d 100644 --- a/bindings/rust/generate/src/main.rs +++ b/bindings/rust/generate/src/main.rs @@ -75,7 +75,7 @@ use libc::{iovec, FILE}; "#; fn gen_bindings(entry: &str, s2n_dir: &Path, functions: FunctionCallbacks) -> bindgen::Builder { - let builder = bindgen::Builder::default() + bindgen::Builder::default() .use_core() .layout_tests(true) .detect_include_paths(true) @@ -99,8 +99,7 @@ fn gen_bindings(entry: &str, s2n_dir: &Path, functions: FunctionCallbacks) -> bi .ctypes_prefix("::libc") .parse_callbacks(Box::new(functions)) .clang_arg(format!("-I{}/api", s2n_dir.display())) - .clang_arg(format!("-I{}", s2n_dir.display())); - builder + .clang_arg(format!("-I{}", s2n_dir.display())) } fn gen_files(input: &Path, out: &Path) -> io::Result<()> { @@ -199,7 +198,8 @@ impl FunctionCallbacks { let mut o = io::BufWriter::new(&mut tests); writeln!(o, "{}", COPYRIGHT)?; - for (feature, function) in functions.iter() { + let iter = functions.iter(); + for (feature, function) in iter { // don't generate tests for types if types.contains(function) { continue; diff --git a/bindings/rust/s2n-tls/src/config.rs b/bindings/rust/s2n-tls/src/config.rs index 51a91776cdc..8fecaff78fd 100644 --- a/bindings/rust/s2n-tls/src/config.rs +++ b/bindings/rust/s2n-tls/src/config.rs @@ -15,7 +15,7 @@ use std::{ sync::atomic::{AtomicUsize, Ordering}, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, Eq, PartialEq)] pub struct Config(NonNull); /// # Safety diff --git a/bindings/rust/s2n-tls/src/enums.rs b/bindings/rust/s2n-tls/src/enums.rs index 99ea3b2c3c2..84ab31e4cea 100644 --- a/bindings/rust/s2n-tls/src/enums.rs +++ b/bindings/rust/s2n-tls/src/enums.rs @@ -7,7 +7,7 @@ use crate::error::Error; use core::convert::TryFrom; use s2n_tls_sys::*; -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum CallbackResult { Success, Failure, @@ -31,7 +31,7 @@ impl From> for CallbackResult { } } -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum Mode { Server, Client, @@ -47,7 +47,7 @@ impl From for s2n_mode::Type { } #[non_exhaustive] -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum Version { SSLV2, SSLV3, @@ -75,7 +75,7 @@ impl TryFrom for Version { } #[non_exhaustive] -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum Blinding { SelfService, BuiltIn, @@ -91,7 +91,7 @@ impl From for s2n_blinding::Type { } #[non_exhaustive] -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum ClientAuthType { Required, Optional, @@ -109,7 +109,7 @@ impl From for s2n_cert_auth_type::Type { } #[non_exhaustive] -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum AlertBehavior { FailOnWarnings, IgnoreWarnings, diff --git a/bindings/rust/s2n-tls/src/error.rs b/bindings/rust/s2n-tls/src/error.rs index 20e494cc249..19d088f91f3 100644 --- a/bindings/rust/s2n-tls/src/error.rs +++ b/bindings/rust/s2n-tls/src/error.rs @@ -8,7 +8,7 @@ use s2n_tls_sys::*; use std::{convert::TryFrom, ffi::CStr}; #[non_exhaustive] -#[derive(Debug, PartialEq)] +#[derive(Debug, Eq, PartialEq)] pub enum ErrorType { UnknownErrorType, NoError, @@ -22,7 +22,7 @@ pub enum ErrorType { } #[non_exhaustive] -#[derive(Debug, PartialEq)] +#[derive(Debug, Eq, PartialEq)] pub enum ErrorSource { Library, Bindings, @@ -44,13 +44,13 @@ impl From for ErrorType { } } -#[derive(Clone, PartialEq)] +#[derive(Clone, Eq, PartialEq)] pub enum Context { InvalidInput, Code(s2n_status_code::Type, Errno), } -#[derive(Clone, PartialEq)] +#[derive(Clone, Eq, PartialEq)] pub struct Error(Context); pub trait Fallible { From 84db729f8723592b963a60f21aaba89dab02aa01 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Mon, 15 Aug 2022 16:28:50 -0700 Subject: [PATCH 2/7] Removed derive Eq and disabled clippy warnings --- bindings/rust/s2n-tls/src/config.rs | 3 ++- bindings/rust/s2n-tls/src/enums.rs | 18 ++++++++++++------ bindings/rust/s2n-tls/src/error.rs | 12 ++++++++---- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/bindings/rust/s2n-tls/src/config.rs b/bindings/rust/s2n-tls/src/config.rs index 8fecaff78fd..0279f89023e 100644 --- a/bindings/rust/s2n-tls/src/config.rs +++ b/bindings/rust/s2n-tls/src/config.rs @@ -15,7 +15,8 @@ use std::{ sync::atomic::{AtomicUsize, Ordering}, }; -#[derive(Debug, Eq, PartialEq)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Debug, PartialEq)] pub struct Config(NonNull); /// # Safety diff --git a/bindings/rust/s2n-tls/src/enums.rs b/bindings/rust/s2n-tls/src/enums.rs index 84ab31e4cea..e480d3b1491 100644 --- a/bindings/rust/s2n-tls/src/enums.rs +++ b/bindings/rust/s2n-tls/src/enums.rs @@ -7,7 +7,8 @@ use crate::error::Error; use core::convert::TryFrom; use s2n_tls_sys::*; -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum CallbackResult { Success, Failure, @@ -31,7 +32,8 @@ impl From> for CallbackResult { } } -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum Mode { Server, Client, @@ -46,8 +48,9 @@ impl From for s2n_mode::Type { } } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum Version { SSLV2, SSLV3, @@ -74,8 +77,9 @@ impl TryFrom for Version { } } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum Blinding { SelfService, BuiltIn, @@ -90,8 +94,9 @@ impl From for s2n_blinding::Type { } } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum ClientAuthType { Required, Optional, @@ -108,8 +113,9 @@ impl From for s2n_cert_auth_type::Type { } } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum AlertBehavior { FailOnWarnings, IgnoreWarnings, diff --git a/bindings/rust/s2n-tls/src/error.rs b/bindings/rust/s2n-tls/src/error.rs index 19d088f91f3..2cd7ba719d5 100644 --- a/bindings/rust/s2n-tls/src/error.rs +++ b/bindings/rust/s2n-tls/src/error.rs @@ -7,8 +7,9 @@ use libc::c_char; use s2n_tls_sys::*; use std::{convert::TryFrom, ffi::CStr}; +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq)] +#[derive(Debug, PartialEq)] pub enum ErrorType { UnknownErrorType, NoError, @@ -21,8 +22,9 @@ pub enum ErrorType { UsageError, } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq)] +#[derive(Debug, PartialEq)] pub enum ErrorSource { Library, Bindings, @@ -44,13 +46,15 @@ impl From for ErrorType { } } -#[derive(Clone, Eq, PartialEq)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq)] pub enum Context { InvalidInput, Code(s2n_status_code::Type, Errno), } -#[derive(Clone, Eq, PartialEq)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq)] pub struct Error(Context); pub trait Fallible { From cd21b2c7db91855a470c4de1151b0b299270d7c6 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Mon, 15 Aug 2022 14:28:35 -0700 Subject: [PATCH 3/7] Fixing cargo clippy complaints --- bindings/rust/generate/src/main.rs | 8 ++++---- bindings/rust/s2n-tls/src/config.rs | 2 +- bindings/rust/s2n-tls/src/enums.rs | 12 ++++++------ bindings/rust/s2n-tls/src/error.rs | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/bindings/rust/generate/src/main.rs b/bindings/rust/generate/src/main.rs index 3f58ba2a845..12013fa980d 100644 --- a/bindings/rust/generate/src/main.rs +++ b/bindings/rust/generate/src/main.rs @@ -75,7 +75,7 @@ use libc::{iovec, FILE}; "#; fn gen_bindings(entry: &str, s2n_dir: &Path, functions: FunctionCallbacks) -> bindgen::Builder { - let builder = bindgen::Builder::default() + bindgen::Builder::default() .use_core() .layout_tests(true) .detect_include_paths(true) @@ -99,8 +99,7 @@ fn gen_bindings(entry: &str, s2n_dir: &Path, functions: FunctionCallbacks) -> bi .ctypes_prefix("::libc") .parse_callbacks(Box::new(functions)) .clang_arg(format!("-I{}/api", s2n_dir.display())) - .clang_arg(format!("-I{}", s2n_dir.display())); - builder + .clang_arg(format!("-I{}", s2n_dir.display())) } fn gen_files(input: &Path, out: &Path) -> io::Result<()> { @@ -199,7 +198,8 @@ impl FunctionCallbacks { let mut o = io::BufWriter::new(&mut tests); writeln!(o, "{}", COPYRIGHT)?; - for (feature, function) in functions.iter() { + let iter = functions.iter(); + for (feature, function) in iter { // don't generate tests for types if types.contains(function) { continue; diff --git a/bindings/rust/s2n-tls/src/config.rs b/bindings/rust/s2n-tls/src/config.rs index 51a91776cdc..8fecaff78fd 100644 --- a/bindings/rust/s2n-tls/src/config.rs +++ b/bindings/rust/s2n-tls/src/config.rs @@ -15,7 +15,7 @@ use std::{ sync::atomic::{AtomicUsize, Ordering}, }; -#[derive(Debug, PartialEq)] +#[derive(Debug, Eq, PartialEq)] pub struct Config(NonNull); /// # Safety diff --git a/bindings/rust/s2n-tls/src/enums.rs b/bindings/rust/s2n-tls/src/enums.rs index 99ea3b2c3c2..84ab31e4cea 100644 --- a/bindings/rust/s2n-tls/src/enums.rs +++ b/bindings/rust/s2n-tls/src/enums.rs @@ -7,7 +7,7 @@ use crate::error::Error; use core::convert::TryFrom; use s2n_tls_sys::*; -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum CallbackResult { Success, Failure, @@ -31,7 +31,7 @@ impl From> for CallbackResult { } } -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum Mode { Server, Client, @@ -47,7 +47,7 @@ impl From for s2n_mode::Type { } #[non_exhaustive] -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum Version { SSLV2, SSLV3, @@ -75,7 +75,7 @@ impl TryFrom for Version { } #[non_exhaustive] -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum Blinding { SelfService, BuiltIn, @@ -91,7 +91,7 @@ impl From for s2n_blinding::Type { } #[non_exhaustive] -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum ClientAuthType { Required, Optional, @@ -109,7 +109,7 @@ impl From for s2n_cert_auth_type::Type { } #[non_exhaustive] -#[derive(Debug, PartialEq, Copy, Clone)] +#[derive(Debug, Eq, PartialEq, Copy, Clone)] pub enum AlertBehavior { FailOnWarnings, IgnoreWarnings, diff --git a/bindings/rust/s2n-tls/src/error.rs b/bindings/rust/s2n-tls/src/error.rs index 20e494cc249..19d088f91f3 100644 --- a/bindings/rust/s2n-tls/src/error.rs +++ b/bindings/rust/s2n-tls/src/error.rs @@ -8,7 +8,7 @@ use s2n_tls_sys::*; use std::{convert::TryFrom, ffi::CStr}; #[non_exhaustive] -#[derive(Debug, PartialEq)] +#[derive(Debug, Eq, PartialEq)] pub enum ErrorType { UnknownErrorType, NoError, @@ -22,7 +22,7 @@ pub enum ErrorType { } #[non_exhaustive] -#[derive(Debug, PartialEq)] +#[derive(Debug, Eq, PartialEq)] pub enum ErrorSource { Library, Bindings, @@ -44,13 +44,13 @@ impl From for ErrorType { } } -#[derive(Clone, PartialEq)] +#[derive(Clone, Eq, PartialEq)] pub enum Context { InvalidInput, Code(s2n_status_code::Type, Errno), } -#[derive(Clone, PartialEq)] +#[derive(Clone, Eq, PartialEq)] pub struct Error(Context); pub trait Fallible { From af3c47155eec69b134aaa308fd5eb5fe4a0e01d6 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Mon, 15 Aug 2022 16:28:50 -0700 Subject: [PATCH 4/7] Removed derive Eq and disabled clippy warnings --- bindings/rust/s2n-tls/src/config.rs | 3 ++- bindings/rust/s2n-tls/src/enums.rs | 18 ++++++++++++------ bindings/rust/s2n-tls/src/error.rs | 12 ++++++++---- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/bindings/rust/s2n-tls/src/config.rs b/bindings/rust/s2n-tls/src/config.rs index 8fecaff78fd..0279f89023e 100644 --- a/bindings/rust/s2n-tls/src/config.rs +++ b/bindings/rust/s2n-tls/src/config.rs @@ -15,7 +15,8 @@ use std::{ sync::atomic::{AtomicUsize, Ordering}, }; -#[derive(Debug, Eq, PartialEq)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Debug, PartialEq)] pub struct Config(NonNull); /// # Safety diff --git a/bindings/rust/s2n-tls/src/enums.rs b/bindings/rust/s2n-tls/src/enums.rs index 84ab31e4cea..e480d3b1491 100644 --- a/bindings/rust/s2n-tls/src/enums.rs +++ b/bindings/rust/s2n-tls/src/enums.rs @@ -7,7 +7,8 @@ use crate::error::Error; use core::convert::TryFrom; use s2n_tls_sys::*; -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum CallbackResult { Success, Failure, @@ -31,7 +32,8 @@ impl From> for CallbackResult { } } -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum Mode { Server, Client, @@ -46,8 +48,9 @@ impl From for s2n_mode::Type { } } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum Version { SSLV2, SSLV3, @@ -74,8 +77,9 @@ impl TryFrom for Version { } } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum Blinding { SelfService, BuiltIn, @@ -90,8 +94,9 @@ impl From for s2n_blinding::Type { } } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum ClientAuthType { Required, Optional, @@ -108,8 +113,9 @@ impl From for s2n_cert_auth_type::Type { } } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq, Copy, Clone)] +#[derive(Debug, PartialEq, Copy, Clone)] pub enum AlertBehavior { FailOnWarnings, IgnoreWarnings, diff --git a/bindings/rust/s2n-tls/src/error.rs b/bindings/rust/s2n-tls/src/error.rs index 19d088f91f3..2cd7ba719d5 100644 --- a/bindings/rust/s2n-tls/src/error.rs +++ b/bindings/rust/s2n-tls/src/error.rs @@ -7,8 +7,9 @@ use libc::c_char; use s2n_tls_sys::*; use std::{convert::TryFrom, ffi::CStr}; +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq)] +#[derive(Debug, PartialEq)] pub enum ErrorType { UnknownErrorType, NoError, @@ -21,8 +22,9 @@ pub enum ErrorType { UsageError, } +#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] -#[derive(Debug, Eq, PartialEq)] +#[derive(Debug, PartialEq)] pub enum ErrorSource { Library, Bindings, @@ -44,13 +46,15 @@ impl From for ErrorType { } } -#[derive(Clone, Eq, PartialEq)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq)] pub enum Context { InvalidInput, Code(s2n_status_code::Type, Errno), } -#[derive(Clone, Eq, PartialEq)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq)] pub struct Error(Context); pub trait Fallible { From 634e7b8bfa1babe53166d71398144af985e35bc9 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Tue, 16 Aug 2022 09:39:40 -0700 Subject: [PATCH 5/7] Moved clippy macro to lib.rs --- bindings/rust/s2n-tls/src/config.rs | 1 - bindings/rust/s2n-tls/src/enums.rs | 6 ------ bindings/rust/s2n-tls/src/error.rs | 4 ---- bindings/rust/s2n-tls/src/lib.rs | 1 + 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/bindings/rust/s2n-tls/src/config.rs b/bindings/rust/s2n-tls/src/config.rs index 0279f89023e..51a91776cdc 100644 --- a/bindings/rust/s2n-tls/src/config.rs +++ b/bindings/rust/s2n-tls/src/config.rs @@ -15,7 +15,6 @@ use std::{ sync::atomic::{AtomicUsize, Ordering}, }; -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq)] pub struct Config(NonNull); diff --git a/bindings/rust/s2n-tls/src/enums.rs b/bindings/rust/s2n-tls/src/enums.rs index e480d3b1491..99ea3b2c3c2 100644 --- a/bindings/rust/s2n-tls/src/enums.rs +++ b/bindings/rust/s2n-tls/src/enums.rs @@ -7,7 +7,6 @@ use crate::error::Error; use core::convert::TryFrom; use s2n_tls_sys::*; -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq, Copy, Clone)] pub enum CallbackResult { Success, @@ -32,7 +31,6 @@ impl From> for CallbackResult { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq, Copy, Clone)] pub enum Mode { Server, @@ -48,7 +46,6 @@ impl From for s2n_mode::Type { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum Version { @@ -77,7 +74,6 @@ impl TryFrom for Version { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum Blinding { @@ -94,7 +90,6 @@ impl From for s2n_blinding::Type { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum ClientAuthType { @@ -113,7 +108,6 @@ impl From for s2n_cert_auth_type::Type { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum AlertBehavior { diff --git a/bindings/rust/s2n-tls/src/error.rs b/bindings/rust/s2n-tls/src/error.rs index 2cd7ba719d5..20e494cc249 100644 --- a/bindings/rust/s2n-tls/src/error.rs +++ b/bindings/rust/s2n-tls/src/error.rs @@ -7,7 +7,6 @@ use libc::c_char; use s2n_tls_sys::*; use std::{convert::TryFrom, ffi::CStr}; -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq)] pub enum ErrorType { @@ -22,7 +21,6 @@ pub enum ErrorType { UsageError, } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq)] pub enum ErrorSource { @@ -46,14 +44,12 @@ impl From for ErrorType { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq)] pub enum Context { InvalidInput, Code(s2n_status_code::Type, Errno), } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq)] pub struct Error(Context); diff --git a/bindings/rust/s2n-tls/src/lib.rs b/bindings/rust/s2n-tls/src/lib.rs index 43406c26d80..509559a6f50 100644 --- a/bindings/rust/s2n-tls/src/lib.rs +++ b/bindings/rust/s2n-tls/src/lib.rs @@ -1,6 +1,7 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +#![allow(clippy::derive_partial_eq_without_eq)] extern crate alloc; #[macro_use] From 33c6ffdcff5d59a60136470d4d26e88e3f6b9ffe Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Tue, 16 Aug 2022 09:43:47 -0700 Subject: [PATCH 6/7] Formatting --- bindings/rust/s2n-tls/src/config.rs | 1 - bindings/rust/s2n-tls/src/enums.rs | 6 ------ bindings/rust/s2n-tls/src/error.rs | 4 ---- bindings/rust/s2n-tls/src/lib.rs | 1 + 4 files changed, 1 insertion(+), 11 deletions(-) diff --git a/bindings/rust/s2n-tls/src/config.rs b/bindings/rust/s2n-tls/src/config.rs index 0279f89023e..51a91776cdc 100644 --- a/bindings/rust/s2n-tls/src/config.rs +++ b/bindings/rust/s2n-tls/src/config.rs @@ -15,7 +15,6 @@ use std::{ sync::atomic::{AtomicUsize, Ordering}, }; -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq)] pub struct Config(NonNull); diff --git a/bindings/rust/s2n-tls/src/enums.rs b/bindings/rust/s2n-tls/src/enums.rs index e480d3b1491..99ea3b2c3c2 100644 --- a/bindings/rust/s2n-tls/src/enums.rs +++ b/bindings/rust/s2n-tls/src/enums.rs @@ -7,7 +7,6 @@ use crate::error::Error; use core::convert::TryFrom; use s2n_tls_sys::*; -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq, Copy, Clone)] pub enum CallbackResult { Success, @@ -32,7 +31,6 @@ impl From> for CallbackResult { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq, Copy, Clone)] pub enum Mode { Server, @@ -48,7 +46,6 @@ impl From for s2n_mode::Type { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum Version { @@ -77,7 +74,6 @@ impl TryFrom for Version { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum Blinding { @@ -94,7 +90,6 @@ impl From for s2n_blinding::Type { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum ClientAuthType { @@ -113,7 +108,6 @@ impl From for s2n_cert_auth_type::Type { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum AlertBehavior { diff --git a/bindings/rust/s2n-tls/src/error.rs b/bindings/rust/s2n-tls/src/error.rs index 2cd7ba719d5..20e494cc249 100644 --- a/bindings/rust/s2n-tls/src/error.rs +++ b/bindings/rust/s2n-tls/src/error.rs @@ -7,7 +7,6 @@ use libc::c_char; use s2n_tls_sys::*; use std::{convert::TryFrom, ffi::CStr}; -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq)] pub enum ErrorType { @@ -22,7 +21,6 @@ pub enum ErrorType { UsageError, } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq)] pub enum ErrorSource { @@ -46,14 +44,12 @@ impl From for ErrorType { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq)] pub enum Context { InvalidInput, Code(s2n_status_code::Type, Errno), } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq)] pub struct Error(Context); diff --git a/bindings/rust/s2n-tls/src/lib.rs b/bindings/rust/s2n-tls/src/lib.rs index 509559a6f50..251d027fa98 100644 --- a/bindings/rust/s2n-tls/src/lib.rs +++ b/bindings/rust/s2n-tls/src/lib.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 #![allow(clippy::derive_partial_eq_without_eq)] + extern crate alloc; #[macro_use] From 79871a32c77748d15c775b12d06fc636ccc87c28 Mon Sep 17 00:00:00 2001 From: Frank Lee Date: Tue, 16 Aug 2022 11:08:56 -0700 Subject: [PATCH 7/7] Fixing rebase --- bindings/rust/s2n-tls/src/config.rs | 1 - bindings/rust/s2n-tls/src/enums.rs | 6 ------ bindings/rust/s2n-tls/src/error.rs | 4 ---- bindings/rust/s2n-tls/src/lib.rs | 2 ++ 4 files changed, 2 insertions(+), 11 deletions(-) diff --git a/bindings/rust/s2n-tls/src/config.rs b/bindings/rust/s2n-tls/src/config.rs index 0279f89023e..51a91776cdc 100644 --- a/bindings/rust/s2n-tls/src/config.rs +++ b/bindings/rust/s2n-tls/src/config.rs @@ -15,7 +15,6 @@ use std::{ sync::atomic::{AtomicUsize, Ordering}, }; -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq)] pub struct Config(NonNull); diff --git a/bindings/rust/s2n-tls/src/enums.rs b/bindings/rust/s2n-tls/src/enums.rs index e480d3b1491..99ea3b2c3c2 100644 --- a/bindings/rust/s2n-tls/src/enums.rs +++ b/bindings/rust/s2n-tls/src/enums.rs @@ -7,7 +7,6 @@ use crate::error::Error; use core::convert::TryFrom; use s2n_tls_sys::*; -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq, Copy, Clone)] pub enum CallbackResult { Success, @@ -32,7 +31,6 @@ impl From> for CallbackResult { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Debug, PartialEq, Copy, Clone)] pub enum Mode { Server, @@ -48,7 +46,6 @@ impl From for s2n_mode::Type { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum Version { @@ -77,7 +74,6 @@ impl TryFrom for Version { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum Blinding { @@ -94,7 +90,6 @@ impl From for s2n_blinding::Type { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum ClientAuthType { @@ -113,7 +108,6 @@ impl From for s2n_cert_auth_type::Type { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq, Copy, Clone)] pub enum AlertBehavior { diff --git a/bindings/rust/s2n-tls/src/error.rs b/bindings/rust/s2n-tls/src/error.rs index 2cd7ba719d5..20e494cc249 100644 --- a/bindings/rust/s2n-tls/src/error.rs +++ b/bindings/rust/s2n-tls/src/error.rs @@ -7,7 +7,6 @@ use libc::c_char; use s2n_tls_sys::*; use std::{convert::TryFrom, ffi::CStr}; -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq)] pub enum ErrorType { @@ -22,7 +21,6 @@ pub enum ErrorType { UsageError, } -#[allow(clippy::derive_partial_eq_without_eq)] #[non_exhaustive] #[derive(Debug, PartialEq)] pub enum ErrorSource { @@ -46,14 +44,12 @@ impl From for ErrorType { } } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq)] pub enum Context { InvalidInput, Code(s2n_status_code::Type, Errno), } -#[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq)] pub struct Error(Context); diff --git a/bindings/rust/s2n-tls/src/lib.rs b/bindings/rust/s2n-tls/src/lib.rs index 43406c26d80..251d027fa98 100644 --- a/bindings/rust/s2n-tls/src/lib.rs +++ b/bindings/rust/s2n-tls/src/lib.rs @@ -1,6 +1,8 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +#![allow(clippy::derive_partial_eq_without_eq)] + extern crate alloc; #[macro_use]