Commit 1c71ddb3 authored by Miguel Ojeda's avatar Miguel Ojeda
Browse files

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.

Reviewed-by: default avatarVincenzo Palazzo <vincenzopalazzodev@gmail.com>
Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
Tested-by: default avatarGary Guo <gary@garyguo.net>
Reviewed-by: default avatarGary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20240904204347.168520-20-ojeda@kernel.org


Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 04866494
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -73,8 +73,7 @@
/// Naive factorial implementation:
///
/// ```rust
/// # #[expect(clippy::disallowed_macros)]
/// # {
/// # #![expect(clippy::disallowed_macros)]
/// fn factorial(n: u32) -> u32 {
///     if dbg!(n <= 1) {
///         dbg!(1)
@@ -84,7 +83,6 @@
/// }
///
/// dbg!(factorial(4));
/// # }
/// ```
///
/// This prints to the kernel log:
@@ -129,11 +127,9 @@
/// invocations. You can use a 1-tuple directly if you need one:
///
/// ```
/// # #[expect(clippy::disallowed_macros)]
/// # {
/// # #![expect(clippy::disallowed_macros)]
/// assert_eq!(1, dbg!(1u32,)); // trailing comma ignored
/// assert_eq!((1,), dbg!((1u32,))); // 1-tuple
/// # }
/// ```
///
/// [`std::dbg`]: https://doc.rust-lang.org/std/macro.dbg.html