Skip to content

Commit

Permalink
refactor: add trailing comma to multiline derives
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
  • Loading branch information
mkroening committed Oct 13, 2024
1 parent c7d8e78 commit ebc29bc
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 137 deletions.
4 changes: 2 additions & 2 deletions bindgen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ gen() {
--with-derive-hash \
--with-derive-partialeq \
--with-derive-eq \
--with-attribute-custom-enum '.*=#[cfg_attr(feature = "num_enum", derive(num_enum::IntoPrimitive,num_enum::TryFromPrimitive,num_enum::UnsafeFromPrimitive))]' \
--with-attribute-custom-struct '.*=#[cfg_attr(feature = "zerocopy", derive(zerocopy_derive::FromZeroes,zerocopy_derive::FromBytes,zerocopy_derive::AsBytes))]' \
--with-attribute-custom-enum '.*=#[cfg_attr(feature = "num_enum", derive(num_enum::IntoPrimitive,num_enum::TryFromPrimitive,num_enum::UnsafeFromPrimitive,))]' \
--with-attribute-custom-struct '.*=#[cfg_attr(feature = "zerocopy", derive(zerocopy_derive::FromZeroes,zerocopy_derive::FromBytes,zerocopy_derive::AsBytes,))]' \
"$@"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ diff --git a/src/linux.rs b/src/linux.rs
+ derive(
+ zerocopy_derive::FromZeroes,
+ zerocopy_derive::FromBytes,
+ zerocopy_derive::AsBytes
+ zerocopy_derive::AsBytes,
+ )
+)]
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
Expand All @@ -32,7 +32,7 @@ diff --git a/src/macos.rs b/src/macos.rs
+ derive(
+ zerocopy_derive::FromZeroes,
+ zerocopy_derive::FromBytes,
+ zerocopy_derive::AsBytes
+ zerocopy_derive::AsBytes,
+ )
+)]
pub struct __IncompleteArrayField<T>(::core::marker::PhantomData<T>, [T; 0]);
Expand Down
Loading

0 comments on commit ebc29bc

Please sign in to comment.