aboutsummaryrefslogtreecommitdiff
path: root/src/logbag.rs
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2021-03-06 12:29:07 +0100
committerDaniel Schadt <kingdread@gmx.de>2021-03-06 12:29:07 +0100
commitd137fa5429c13a98ebcf6ec9a00ae1d12ee6f97e (patch)
tree4ab483c2560703d7b0e988064a728d708c5a4063 /src/logbag.rs
parent85ed8053e5fd20902e156a120dadd3f418d52a1e (diff)
downloadezau-d137fa5429c13a98ebcf6ec9a00ae1d12ee6f97e.tar.gz
ezau-d137fa5429c13a98ebcf6ec9a00ae1d12ee6f97e.tar.bz2
ezau-d137fa5429c13a98ebcf6ec9a00ae1d12ee6f97e.zip
only compile LogBag::{new,categories} in tests
Those functions are not used anywhere else and just produce dead code warnings.
Diffstat (limited to 'src/logbag.rs')
-rw-r--r--src/logbag.rs2
1 files changed, 2 insertions, 0 deletions
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<Item = &str> {
self.data.iter().map(|x| &x.0 as &str)
}