Skip to content

Commit 1e6fc47

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 6905678 commit 1e6fc47

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
@@ -73,8 +73,7 @@
7373
/// Naive factorial implementation:
7474
///
7575
/// ```rust
76-
/// # #[expect(clippy::disallowed_macros)]
77-
/// # {
76+
/// # #![expect(clippy::disallowed_macros)]
7877
/// fn factorial(n: u32) -> u32 {
7978
/// if dbg!(n <= 1) {
8079
/// dbg!(1)
@@ -84,7 +83,6 @@
8483
/// }
8584
///
8685
/// dbg!(factorial(4));
87-
/// # }
8886
/// ```
8987
///
9088
/// This prints to the kernel log:
@@ -129,11 +127,9 @@
129127
/// invocations. You can use a 1-tuple directly if you need one:
130128
///
131129
/// ```
132-
/// # #[expect(clippy::disallowed_macros)]
133-
/// # {
130+
/// # #![expect(clippy::disallowed_macros)]
134131
/// assert_eq!(1, dbg!(1u32,)); // trailing comma ignored
135132
/// assert_eq!((1,), dbg!((1u32,))); // 1-tuple
136-
/// # }
137133
/// ```
138134
///
139135
/// [`std::dbg`]: https://doc.rust-lang.org/std/macro.dbg.html

0 commit comments

Comments
 (0)