From 9c81d5e74767b10c5a49bbdf9e3c38becbbd89b7 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 7 Jan 2025 10:46:09 +1100 Subject: [PATCH] io: Move macro_export below docs The `io::macros` crate uses a kind of nifty trick of putting `macro_export` _above_ the docs. But we do not do this anywhere else in the code base so its a bit surprising. We should be uniform. Simply because its an easier change move the `macro_export` attribute to be under the docs. Internal change only. --- io/src/macros.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/io/src/macros.rs b/io/src/macros.rs index 4904a826d..26e9d1a2d 100644 --- a/io/src/macros.rs +++ b/io/src/macros.rs @@ -1,6 +1,5 @@ // SPDX-License-Identifier: CC0-1.0 -#[macro_export] /// Because we cannot provide a blanket implementation of [`std::io::Write`] for all implementers /// of this crate's `io::Write` trait, we provide this macro instead. /// @@ -9,6 +8,7 @@ /// that feature. In any case, this crate's `io::Write` feature will be implemented for the given /// type, even if indirectly. #[cfg(not(feature = "std"))] +#[macro_export] macro_rules! impl_write { ($ty: ty, $write_fn: expr, $flush_fn: expr $(, $bounded_ty: ident : $bounds: path),*) => { impl<$($bounded_ty: $bounds),*> $crate::Write for $ty { @@ -24,7 +24,6 @@ macro_rules! impl_write { } } -#[macro_export] /// Because we cannot provide a blanket implementation of [`std::io::Write`] for all implementers /// of this crate's `io::Write` trait, we provide this macro instead. /// @@ -33,6 +32,7 @@ macro_rules! impl_write { /// that feature. In any case, this crate's `io::Write` feature will be implemented for the given /// type, even if indirectly. #[cfg(feature = "std")] +#[macro_export] macro_rules! impl_write { ($ty: ty, $write_fn: expr, $flush_fn: expr $(, $bounded_ty: ident : $bounds: path),*) => { impl<$($bounded_ty: $bounds),*> std::io::Write for $ty {