Drive-by clippy fixes.

This commit is contained in:
Emilio Cobos Álvarez 2022-08-30 14:15:37 +02:00
parent 47b1d1de1e
commit ae321d80ff
3 changed files with 11 additions and 11 deletions

View File

@ -34,7 +34,7 @@ pub struct Bindings {
noop: bool,
}
#[derive(PartialEq)]
#[derive(PartialEq, Eq)]
enum NamespaceOperation {
Open,
Close,

View File

@ -18,7 +18,7 @@ pub use crate::bindgen::rename::RenameRule;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
/// A language type to generate bindings for.
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Language {
Cxx,
C,
@ -115,7 +115,7 @@ impl FromStr for LineEndingStyle {
deserialize_enum_str!(LineEndingStyle);
/// A style of braces to use for generating code.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Braces {
SameLine,
NextLine,
@ -138,7 +138,7 @@ impl FromStr for Braces {
deserialize_enum_str!(Braces);
/// A type of layout to use when generating long lines of code.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Layout {
Horizontal,
Vertical,
@ -164,7 +164,7 @@ impl FromStr for Layout {
deserialize_enum_str!(Layout);
/// How the comments containing documentation should be styled.
#[derive(Debug, Clone, PartialEq, Copy)]
#[derive(Debug, Clone, PartialEq, Eq, Copy)]
pub enum DocumentationStyle {
C,
C99,
@ -213,7 +213,7 @@ impl FromStr for DocumentationLength {
deserialize_enum_str!(DocumentationLength);
/// A style of Style to use when generating structs and enums.
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Style {
Both,
Tag,
@ -270,7 +270,7 @@ impl FromStr for Style {
deserialize_enum_str!(Style);
/// Different item types that we can generate and filter.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ItemType {
Constants,
Globals,
@ -304,7 +304,7 @@ impl FromStr for ItemType {
deserialize_enum_str!(ItemType);
/// Type which specifies the sort order of functions
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum SortKey {
Name,
None,
@ -723,7 +723,7 @@ pub struct MacroExpansionConfig {
}
/// Controls which Cargo profile is used for macro expansion.
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Profile {
Debug,
Release,

View File

@ -201,13 +201,13 @@ pub trait ToCondition: Sized {
fn to_condition(&self, config: &Config) -> Option<Condition>;
}
impl<'a> ToCondition for Option<Cfg> {
impl ToCondition for Option<Cfg> {
fn to_condition(&self, config: &Config) -> Option<Condition> {
self.as_ref()?.to_condition(config)
}
}
impl<'a> ToCondition for Cfg {
impl ToCondition for Cfg {
fn to_condition(&self, config: &Config) -> Option<Condition> {
match *self {
Cfg::Boolean(ref cfg_name) => {