Fix warnings

This commit is contained in:
sharkdp 2019-09-15 10:48:29 +02:00
parent a0505bd4df
commit 1d16cd855e
2 changed files with 3 additions and 6 deletions

View file

@ -80,8 +80,8 @@ mod tests {
};
}
/// Parsing and size conversion tests data. Ensure that each type gets properly interpreted.
/// Call with higher base values to ensure expected multiplication (only need a couple)
// Parsing and size conversion tests data. Ensure that each type gets properly interpreted.
// Call with higher base values to ensure expected multiplication (only need a couple)
gen_size_filter_parse_test! {
byte_plus: ("+1b", SizeFilter::Min(1)),
byte_plus_multiplier: ("+10b", SizeFilter::Min(10)),
@ -168,7 +168,7 @@ mod tests {
};
}
/// Invalid parse data
// Invalid parse data
gen_size_filter_failure! {
ensure_missing_symbol_returns_none: "10M",
ensure_missing_number_returns_none: "+g",

View file

@ -9,7 +9,6 @@ pub enum TimeFilter {
impl TimeFilter {
fn from_str(ref_time: &SystemTime, s: &str) -> Option<SystemTime> {
use humantime;
humantime::parse_duration(s)
.map(|duration| *ref_time - duration)
.or_else(|_| humantime::parse_rfc3339_weak(s))
@ -39,8 +38,6 @@ mod tests {
#[test]
fn is_time_filter_applicable() {
use humantime;
let ref_time = humantime::parse_rfc3339("2010-10-10T10:10:10Z").unwrap();
assert!(TimeFilter::after(&ref_time, "1min")
.unwrap()