Skip to content

Commit 85eb0f4

Browse files
fredszaqemilio
authored andcommitted
Bump clippy msrv to 1.64
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
1 parent 43af1eb commit 85eb0f4

6 files changed

Lines changed: 10 additions & 30 deletions

File tree

.clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Specify the minimum supported Rust version
2-
msrv = "1.57.0"
2+
msrv = "1.64.0"

src/bindgen/config.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ impl Language {
6161
/// Controls what type of line endings are used in the generated code.
6262
#[derive(Debug, Clone, Copy)]
6363
#[allow(clippy::upper_case_acronyms)]
64+
#[derive(Default)]
6465
pub enum LineEndingStyle {
6566
/// Use Unix-style linefeed characters
67+
#[default]
6668
LF,
6769
/// Use classic Mac-style carriage-return characters
6870
CR,
@@ -72,12 +74,6 @@ pub enum LineEndingStyle {
7274
Native,
7375
}
7476

75-
impl Default for LineEndingStyle {
76-
fn default() -> Self {
77-
LineEndingStyle::LF
78-
}
79-
}
80-
8177
impl LineEndingStyle {
8278
pub fn as_str(&self) -> &'static str {
8379
match self {
@@ -213,8 +209,9 @@ impl FromStr for DocumentationLength {
213209
deserialize_enum_str!(DocumentationLength);
214210

215211
/// A style of Style to use when generating structs and enums.
216-
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
212+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
217213
pub enum Style {
214+
#[default]
218215
Both,
219216
Tag,
220217
Type,
@@ -245,12 +242,6 @@ impl Style {
245242
}
246243
}
247244

248-
impl Default for Style {
249-
fn default() -> Self {
250-
Style::Both
251-
}
252-
}
253-
254245
impl FromStr for Style {
255246
type Err = String;
256247

src/bindgen/ir/repr.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@ use syn::ext::IdentExt;
66

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

9-
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
9+
#[derive(Debug, Copy, Clone, PartialEq, Eq, Default)]
1010
pub enum ReprStyle {
11+
#[default]
1112
Rust,
1213
C,
1314
Transparent,
1415
}
1516

16-
impl Default for ReprStyle {
17-
fn default() -> Self {
18-
ReprStyle::Rust
19-
}
20-
}
21-
2217
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
2318
pub struct ReprType {
2419
kind: IntKind,

src/bindgen/rename.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ impl<'a> IdentifierType<'a> {
2828
}
2929

3030
/// A rule to apply to an identifier when generating bindings.
31-
#[derive(Debug, Clone, Copy)]
31+
#[derive(Debug, Clone, Copy, Default)]
3232
pub enum RenameRule {
3333
/// Do not apply any renaming. The default.
34+
#[default]
3435
None,
3536
/// Converts the identifier to PascalCase and adds a context dependent prefix
3637
GeckoCase,
@@ -93,12 +94,6 @@ impl RenameRule {
9394
}
9495
}
9596

96-
impl Default for RenameRule {
97-
fn default() -> RenameRule {
98-
RenameRule::None
99-
}
100-
}
101-
10297
impl FromStr for RenameRule {
10398
type Err = String;
10499

tests/depfile.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ fn test_project(project_path: &str) {
9393
);
9494

9595
std::fs::remove_dir_all(build_dir).expect("Failed to remove old build directory");
96-
()
9796
}
9897

9998
macro_rules! test_file {

tests/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ fn run_compile_test(
251251
);
252252
if generate_depfile {
253253
let depfile = depfile_contents.expect("No depfile generated");
254-
assert!(depfile.len() > 0);
254+
assert!(!depfile.is_empty());
255255
let mut rules = depfile.split(':');
256256
let target = rules.next().expect("No target found");
257257
assert_eq!(target, generated_file.as_os_str().to_str().unwrap());

0 commit comments

Comments
 (0)