Skip to content

Commit

Permalink
Bump clippy msrv to 1.64
Browse files Browse the repository at this point in the history
the msrv was bumped in in the Cargo.toml #847 but not in clippy.toml,
clippy was complaining at startup and defaulting to 1.57
  • Loading branch information
fredszaq authored and emilio committed Sep 8, 2023
1 parent 43af1eb commit 85eb0f4
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .clippy.toml
@@ -1,2 +1,2 @@
# Specify the minimum supported Rust version
msrv = "1.57.0"
msrv = "1.64.0"
17 changes: 4 additions & 13 deletions src/bindgen/config.rs
Expand Up @@ -61,8 +61,10 @@ impl Language {
/// Controls what type of line endings are used in the generated code.
#[derive(Debug, Clone, Copy)]
#[allow(clippy::upper_case_acronyms)]
#[derive(Default)]
pub enum LineEndingStyle {
/// Use Unix-style linefeed characters
#[default]
LF,
/// Use classic Mac-style carriage-return characters
CR,
Expand All @@ -72,12 +74,6 @@ pub enum LineEndingStyle {
Native,
}

impl Default for LineEndingStyle {
fn default() -> Self {
LineEndingStyle::LF
}
}

impl LineEndingStyle {
pub fn as_str(&self) -> &'static str {
match self {
Expand Down Expand Up @@ -213,8 +209,9 @@ impl FromStr for DocumentationLength {
deserialize_enum_str!(DocumentationLength);

/// A style of Style to use when generating structs and enums.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
pub enum Style {
#[default]
Both,
Tag,
Type,
Expand Down Expand Up @@ -245,12 +242,6 @@ impl Style {
}
}

impl Default for Style {
fn default() -> Self {
Style::Both
}
}

impl FromStr for Style {
type Err = String;

Expand Down
9 changes: 2 additions & 7 deletions src/bindgen/ir/repr.rs
Expand Up @@ -6,19 +6,14 @@ use syn::ext::IdentExt;

use crate::bindgen::ir::ty::{IntKind, PrimitiveType};

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
pub enum ReprStyle {
#[default]
Rust,
C,
Transparent,
}

impl Default for ReprStyle {
fn default() -> Self {
ReprStyle::Rust
}
}

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub struct ReprType {
kind: IntKind,
Expand Down
9 changes: 2 additions & 7 deletions src/bindgen/rename.rs
Expand Up @@ -28,9 +28,10 @@ impl<'a> IdentifierType<'a> {
}

/// A rule to apply to an identifier when generating bindings.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, Default)]
pub enum RenameRule {
/// Do not apply any renaming. The default.
#[default]
None,
/// Converts the identifier to PascalCase and adds a context dependent prefix
GeckoCase,
Expand Down Expand Up @@ -93,12 +94,6 @@ impl RenameRule {
}
}

impl Default for RenameRule {
fn default() -> RenameRule {
RenameRule::None
}
}

impl FromStr for RenameRule {
type Err = String;

Expand Down
1 change: 0 additions & 1 deletion tests/depfile.rs
Expand Up @@ -93,7 +93,6 @@ fn test_project(project_path: &str) {
);

std::fs::remove_dir_all(build_dir).expect("Failed to remove old build directory");
()
}

macro_rules! test_file {
Expand Down
2 changes: 1 addition & 1 deletion tests/tests.rs
Expand Up @@ -251,7 +251,7 @@ fn run_compile_test(
);
if generate_depfile {
let depfile = depfile_contents.expect("No depfile generated");
assert!(depfile.len() > 0);
assert!(!depfile.is_empty());
let mut rules = depfile.split(':');
let target = rules.next().expect("No target found");
assert_eq!(target, generated_file.as_os_str().to_str().unwrap());
Expand Down

0 comments on commit 85eb0f4

Please sign in to comment.