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.
This commit is contained in:
Tobin C. Harding 2025-01-07 10:46:09 +11:00
parent b109177e11
commit 9c81d5e747
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,5 @@
// SPDX-License-Identifier: CC0-1.0 // SPDX-License-Identifier: CC0-1.0
#[macro_export]
/// Because we cannot provide a blanket implementation of [`std::io::Write`] for all implementers /// 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. /// 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 /// that feature. In any case, this crate's `io::Write` feature will be implemented for the given
/// type, even if indirectly. /// type, even if indirectly.
#[cfg(not(feature = "std"))] #[cfg(not(feature = "std"))]
#[macro_export]
macro_rules! impl_write { macro_rules! impl_write {
($ty: ty, $write_fn: expr, $flush_fn: expr $(, $bounded_ty: ident : $bounds: path),*) => { ($ty: ty, $write_fn: expr, $flush_fn: expr $(, $bounded_ty: ident : $bounds: path),*) => {
impl<$($bounded_ty: $bounds),*> $crate::Write for $ty { 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 /// 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. /// 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 /// that feature. In any case, this crate's `io::Write` feature will be implemented for the given
/// type, even if indirectly. /// type, even if indirectly.
#[cfg(feature = "std")] #[cfg(feature = "std")]
#[macro_export]
macro_rules! impl_write { macro_rules! impl_write {
($ty: ty, $write_fn: expr, $flush_fn: expr $(, $bounded_ty: ident : $bounds: path),*) => { ($ty: ty, $write_fn: expr, $flush_fn: expr $(, $bounded_ty: ident : $bounds: path),*) => {
impl<$($bounded_ty: $bounds),*> std::io::Write for $ty { impl<$($bounded_ty: $bounds),*> std::io::Write for $ty {