Make rustfmt happy
diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs
index 90314a5..1fad91f 100644
--- a/src/codegen/mod.rs
+++ b/src/codegen/mod.rs
@@ -2323,16 +2323,24 @@
/// Create a `EnumVariation` from a string.
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
- "rust" => Ok(EnumVariation::Rust{ non_exhaustive: false }),
- "rust_non_exhaustive" => Ok(EnumVariation::Rust{ non_exhaustive: true }),
+ "rust" => Ok(EnumVariation::Rust {
+ non_exhaustive: false,
+ }),
+ "rust_non_exhaustive" => Ok(EnumVariation::Rust {
+ non_exhaustive: true,
+ }),
"bitfield" => Ok(EnumVariation::NewType { is_bitfield: true }),
"consts" => Ok(EnumVariation::Consts),
"moduleconsts" => Ok(EnumVariation::ModuleConsts),
"newtype" => Ok(EnumVariation::NewType { is_bitfield: false }),
- _ => Err(std::io::Error::new(std::io::ErrorKind::InvalidInput,
- concat!("Got an invalid EnumVariation. Accepted values ",
- "are 'rust', 'rust_non_exhaustive', 'bitfield', 'consts',",
- "'moduleconsts', and 'newtype'."))),
+ _ => Err(std::io::Error::new(
+ std::io::ErrorKind::InvalidInput,
+ concat!(
+ "Got an invalid EnumVariation. Accepted values ",
+ "are 'rust', 'rust_non_exhaustive', 'bitfield', 'consts',",
+ "'moduleconsts', and 'newtype'."
+ ),
+ )),
}
}
}
diff --git a/src/ir/enum_ty.rs b/src/ir/enum_ty.rs
index 95e7e1f..f201384 100644
--- a/src/ir/enum_ty.rs
+++ b/src/ir/enum_ty.rs
@@ -184,11 +184,8 @@
item,
) {
EnumVariation::NewType { is_bitfield: true }
- } else if self.is_matching_enum(
- ctx,
- &ctx.options().newtype_enums,
- item,
- ) {
+ } else if self.is_matching_enum(ctx, &ctx.options().newtype_enums, item)
+ {
EnumVariation::NewType { is_bitfield: false }
} else if self.is_matching_enum(
ctx,
diff --git a/src/lib.rs b/src/lib.rs
index c15d20b..8c8dd19 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -236,12 +236,12 @@
codegen::EnumVariation::Rust {
non_exhaustive: true,
} => "rust_non_exhaustive",
- codegen::EnumVariation::NewType {
- is_bitfield: true,
- } => "bitfield",
- codegen::EnumVariation::NewType {
- is_bitfield: false,
- } => "newtype",
+ codegen::EnumVariation::NewType { is_bitfield: true } => {
+ "bitfield"
+ }
+ codegen::EnumVariation::NewType { is_bitfield: false } => {
+ "newtype"
+ }
codegen::EnumVariation::Consts => "consts",
codegen::EnumVariation::ModuleConsts => "moduleconsts",
}