Skip to content

Commit fe9f7de

Browse files
committed
imaprove macro
1 parent fdd71f6 commit fe9f7de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/sys/flags.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ use super::bindings::tsk_flags_t;
66
use std::ops::BitXorAssign;
77

88
macro_rules! make_constant_self {
9-
($name: ident, $constant: ident) => {
9+
($(#[$attr:meta])* => $name: ident, $constant: ident) => {
10+
$(#[$attr])*
1011
pub const $name: Self = Self(ll_bindings::$constant);
1112
}
1213
}
@@ -677,8 +678,9 @@ pub struct NodeFlags(tsk_flags_t);
677678
impl NodeFlags {
678679
/// Default (empty)
679680
pub const NONE: Self = Self(0);
680-
/// Node is a sample
681-
make_constant_self!(IS_SAMPLE, TSK_NODE_IS_SAMPLE);
681+
make_constant_self!(
682+
/// Node is a sample
683+
=> IS_SAMPLE, TSK_NODE_IS_SAMPLE);
682684

683685
/// Create a new flags instance with `IS_SAMPLE` set.
684686
pub fn new_sample() -> Self {

0 commit comments

Comments
 (0)