Skip to content

Commit 2228f34

Browse files
committed
rust: std_vendor: simplify { .. macro! .. } with inner attributes
It is cleaner to have a single inner attribute rather than needing several hidden lines to wrap the macro invocations. Thus simplify them. Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 2115682 commit 2228f34

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

rust/kernel/std_vendor.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@
7171
/// Naive factorial implementation:
7272
///
7373
/// ```rust
74-
/// # #[expect(clippy::disallowed_macros)]
75-
/// # {
74+
/// # #![expect(clippy::disallowed_macros)]
7675
/// fn factorial(n: u32) -> u32 {
7776
/// if dbg!(n <= 1) {
7877
/// dbg!(1)
@@ -82,7 +81,6 @@
8281
/// }
8382
///
8483
/// dbg!(factorial(4));
85-
/// # }
8684
/// ```
8785
///
8886
/// This prints to the kernel log:
@@ -127,11 +125,9 @@
127125
/// invocations. You can use a 1-tuple directly if you need one:
128126
///
129127
/// ```
130-
/// # #[expect(clippy::disallowed_macros)]
131-
/// # {
128+
/// # #![expect(clippy::disallowed_macros)]
132129
/// assert_eq!(1, dbg!(1u32,)); // trailing comma ignored
133130
/// assert_eq!((1,), dbg!((1u32,))); // 1-tuple
134-
/// # }
135131
/// ```
136132
///
137133
/// [`std::dbg`]: https://doc.rust-lang.org/std/macro.dbg.html

0 commit comments

Comments
 (0)