Skip to content

Commit f94b50d

Browse files
pekkarremilio
authored andcommitted
Fix clippy::derivable_impls lint
1 parent 6bb8512 commit f94b50d

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

bindgen/codegen/mod.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4107,9 +4107,10 @@ impl FromStr for AliasVariation {
41074107
}
41084108

41094109
/// Enum for how non-`Copy` `union`s should be translated.
4110-
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
4110+
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
41114111
pub enum NonCopyUnionStyle {
41124112
/// Wrap members in a type generated by `bindgen`.
4113+
#[default]
41134114
BindgenWrapper,
41144115
/// Wrap members in [`::core::mem::ManuallyDrop`].
41154116
///
@@ -4129,12 +4130,6 @@ impl fmt::Display for NonCopyUnionStyle {
41294130
}
41304131
}
41314132

4132-
impl Default for NonCopyUnionStyle {
4133-
fn default() -> Self {
4134-
Self::BindgenWrapper
4135-
}
4136-
}
4137-
41384133
impl FromStr for NonCopyUnionStyle {
41394134
type Err = std::io::Error;
41404135

bindgen/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,24 +167,19 @@ impl Default for CodegenConfig {
167167
}
168168

169169
/// Formatting tools that can be used to format the bindings
170-
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
170+
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
171171
#[non_exhaustive]
172172
pub enum Formatter {
173173
/// Do not format the bindings.
174174
None,
175175
/// Use `rustfmt` to format the bindings.
176+
#[default]
176177
Rustfmt,
177178
#[cfg(feature = "prettyplease")]
178179
/// Use `prettyplease` to format the bindings.
179180
Prettyplease,
180181
}
181182

182-
impl Default for Formatter {
183-
fn default() -> Self {
184-
Self::Rustfmt
185-
}
186-
}
187-
188183
impl FromStr for Formatter {
189184
type Err = String;
190185

0 commit comments

Comments
 (0)