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 committed Sep 7, 2023
1 parent f72e447 commit f1d70d9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .clippy.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Specify the minimum supported Rust version
msrv = "1.57.0"
msrv = "1.64.0"
16 changes: 6 additions & 10 deletions src/bindgen/config.rs
Original file line number Diff line number Diff line change
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,11 +74,7 @@ pub enum LineEndingStyle {
Native,
}

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


impl LineEndingStyle {
pub fn as_str(&self) -> &'static str {
Expand Down Expand Up @@ -214,7 +212,9 @@ deserialize_enum_str!(DocumentationLength);

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

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


impl FromStr for Style {
type Err = String;
Expand Down
8 changes: 3 additions & 5 deletions src/bindgen/ir/repr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@ use syn::ext::IdentExt;
use crate::bindgen::ir::ty::{IntKind, PrimitiveType};

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[derive(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 {
Expand Down
8 changes: 3 additions & 5 deletions src/bindgen/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ impl<'a> IdentifierType<'a> {

/// A rule to apply to an identifier when generating bindings.
#[derive(Debug, Clone, Copy)]
#[derive(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,11 +95,7 @@ impl RenameRule {
}
}

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


impl FromStr for RenameRule {
type Err = String;
Expand Down
2 changes: 1 addition & 1 deletion tests/depfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ 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
Original file line number Diff line number Diff line change
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 f1d70d9

Please sign in to comment.