From 7030224fd2a97b3551fdd47c43249e3a42341238 Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 18 Apr 2020 15:10:59 +0200 Subject: make filters Debug It's nice if you can print out the filter tree for debugging, so we're requireing filters to be Debug now. --- src/filters/log.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/filters/log.rs') diff --git a/src/filters/log.rs b/src/filters/log.rs index ded4c44..8b84bf3 100644 --- a/src/filters/log.rs +++ b/src/filters/log.rs @@ -47,6 +47,18 @@ impl OutcomeFilter { pub fn new(outcomes: HashSet) -> Box { Box::new(OutcomeFilter(outcomes)) } + + pub fn success() -> Box { + let mut outcomes = HashSet::new(); + outcomes.insert(FightOutcome::Success); + Self::new(outcomes) + } + + pub fn wipe() -> Box { + let mut outcomes = HashSet::new(); + outcomes.insert(FightOutcome::Wipe); + Self::new(outcomes) + } } impl Filter for OutcomeFilter { -- cgit v1.2.3