Skip to content

Commit

Permalink
Ignore unused macros more holistically
Browse files Browse the repository at this point in the history
Instead of `allow`ing potentially unused individual macros from the
internal log module, let's allow them holistically on the module level.

Signed-off-by: Daniel Müller <[email protected]>
  • Loading branch information
d-e-s-o authored and danielocfb committed Nov 21, 2023
1 parent 2679b6f commit ac674ed
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,19 @@ impl From<u32> for Pid {

#[cfg(feature = "tracing")]
#[macro_use]
#[allow(unused_imports)]
mod log {
#[allow(unused)]
pub(crate) use tracing::debug;
pub(crate) use tracing::error;

pub(crate) use tracing::instrument;

#[allow(unused)]
pub(crate) use tracing::info;
#[allow(unused)]
pub(crate) use tracing::instrument;
pub(crate) use tracing::trace;
pub(crate) use tracing::warn;
}

#[cfg(not(feature = "tracing"))]
#[macro_use]
#[allow(unused_imports)]
mod log {
macro_rules! debug {
($($args:tt)*) => {{
Expand All @@ -147,12 +144,9 @@ mod log {
}
}};
}
#[allow(unused)]
pub(crate) use debug;
pub(crate) use debug as error;
#[allow(unused)]
pub(crate) use debug as info;
#[allow(unused)]
pub(crate) use debug as trace;
pub(crate) use debug as warn;
}

0 comments on commit ac674ed

Please sign in to comment.