From d137fa5429c13a98ebcf6ec9a00ae1d12ee6f97e Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Sat, 6 Mar 2021 12:29:07 +0100 Subject: only compile LogBag::{new,categories} in tests Those functions are not used anywhere else and just produce dead code warnings. --- src/logbag.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/logbag.rs b/src/logbag.rs index 6575ecd..f94b80a 100644 --- a/src/logbag.rs +++ b/src/logbag.rs @@ -16,11 +16,13 @@ pub struct LogBag { impl LogBag { /// Construct a new, empty [`LogBag`]. + #[cfg(test)] pub fn new() -> Self { LogBag { data: Vec::new() } } /// Return an iterator over all available categories. + #[cfg(test)] pub fn categories(&self) -> impl Iterator { self.data.iter().map(|x| &x.0 as &str) } -- cgit v1.2.3