aboutsummaryrefslogtreecommitdiff
path: root/src/filters
diff options
context:
space:
mode:
authorDaniel <kingdread@gmx.de>2020-06-12 16:04:17 +0200
committerDaniel <kingdread@gmx.de>2020-06-12 16:04:17 +0200
commit918f1e4eeab94ee8850aefd7c17b48ea2adcd6d2 (patch)
tree7f028c39921f89eefebae156651bbe2443fd07c8 /src/filters
parent4a3e7137334601828f56a3ee614f01d84bada4ce (diff)
downloadraidgrep-918f1e4eeab94ee8850aefd7c17b48ea2adcd6d2.tar.gz
raidgrep-918f1e4eeab94ee8850aefd7c17b48ea2adcd6d2.tar.bz2
raidgrep-918f1e4eeab94ee8850aefd7c17b48ea2adcd6d2.zip
fix up doc comments and tests
Diffstat (limited to 'src/filters')
-rw-r--r--src/filters/log.rs5
-rw-r--r--src/filters/mod.rs4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/filters/log.rs b/src/filters/log.rs
index bde02e5..30cf0cb 100644
--- a/src/filters/log.rs
+++ b/src/filters/log.rs
@@ -122,12 +122,12 @@ pub fn log_time(lower: Option<DateTime<Utc>>, upper: Option<DateTime<Utc>>) -> B
Box::new(TimeFilter(lower, upper))
}
-/// Like [`after`][after], but ignores the file name for date calculations.
+/// Only include logs after the given date, but ignore the file name for date calculations.
pub fn log_after(when: DateTime<Utc>) -> Box<dyn LogFilter> {
log_time(Some(when), None)
}
-/// Like [`before`][before], but ignores the file name for date calculations.
+/// Only include logs before the given date, but ignore the file name for date calculations.
pub fn log_before(when: DateTime<Utc>) -> Box<dyn LogFilter> {
log_time(None, Some(when))
}
@@ -148,6 +148,7 @@ pub fn challenge_mote() -> Box<dyn LogFilter> {
#[cfg(test)]
mod tests {
+ use chrono::TimeZone;
use super::*;
#[test]
diff --git a/src/filters/mod.rs b/src/filters/mod.rs
index e966851..7ab0d42 100644
--- a/src/filters/mod.rs
+++ b/src/filters/mod.rs
@@ -63,8 +63,8 @@ pub trait Filter<Early, Late>: Send + Sync + fmt::Debug {
/// Determine early (before processing all events) whether the log stands a chance to be
/// included.
///
- /// Note that you can return [Inclusion::Unkown] if this filter cannot determine yet a definite
- /// answer.
+ /// Note that you can return [Inclusion::Unknown] if this filter cannot determine yet a
+ /// definite answer.
fn filter_early(&self, _: &Early) -> Inclusion {
Inclusion::Unknown
}