mirror of
https://gitee.com/openharmony/third_party_rust_bitflags
synced 2024-11-23 07:10:11 +00:00
Merge pull request #90 from topecongiro/hide-impl-macro
Hide impl implementation detail from bitflags! documentation
This commit is contained in:
commit
fc7a9fe685
15
src/lib.rs
15
src/lib.rs
@ -192,8 +192,8 @@ macro_rules! bitflags {
|
||||
|
||||
$($(#[$Flag_attr])* pub const $Flag: $BitFlags = $BitFlags { bits: $value };)+
|
||||
|
||||
bitflags! {
|
||||
@_impl struct $BitFlags: $T {
|
||||
__impl_bitflags! {
|
||||
struct $BitFlags: $T {
|
||||
$($(#[$Flag_attr])* const $Flag = $value;)+
|
||||
}
|
||||
}
|
||||
@ -209,14 +209,19 @@ macro_rules! bitflags {
|
||||
|
||||
$($(#[$Flag_attr])* const $Flag: $BitFlags = $BitFlags { bits: $value };)+
|
||||
|
||||
bitflags! {
|
||||
@_impl struct $BitFlags: $T {
|
||||
__impl_bitflags! {
|
||||
struct $BitFlags: $T {
|
||||
$($(#[$Flag_attr])* const $Flag = $value;)+
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
(@_impl struct $BitFlags:ident: $T:ty {
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
#[doc(hidden)]
|
||||
macro_rules! __impl_bitflags {
|
||||
(struct $BitFlags:ident: $T:ty {
|
||||
$($(#[$Flag_attr:meta])* const $Flag:ident = $value:expr;)+
|
||||
}) => {
|
||||
impl $crate::__core::fmt::Debug for $BitFlags {
|
||||
|
Loading…
Reference in New Issue
Block a user