Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions bindgen/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4107,9 +4107,10 @@ impl FromStr for AliasVariation {
}

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

impl Default for NonCopyUnionStyle {
fn default() -> Self {
Self::BindgenWrapper
}
}

impl FromStr for NonCopyUnionStyle {
type Err = std::io::Error;

Expand Down
9 changes: 2 additions & 7 deletions bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,19 @@ impl Default for CodegenConfig {
}

/// Formatting tools that can be used to format the bindings
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
#[non_exhaustive]
pub enum Formatter {
/// Do not format the bindings.
None,
/// Use `rustfmt` to format the bindings.
#[default]
Rustfmt,
#[cfg(feature = "prettyplease")]
/// Use `prettyplease` to format the bindings.
Prettyplease,
}

impl Default for Formatter {
fn default() -> Self {
Self::Rustfmt
}
}

impl FromStr for Formatter {
type Err = String;

Expand Down