diff options
-rw-r--r-- | src/app.rs | 2 | ||||
-rw-r--r-- | src/flags.rs | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -206,7 +206,7 @@ pub fn build() -> App<'static, 'static> { fn validate_date_argument(arg: String) -> Result<(), String> { use std::error::Error; - if arg.starts_with("+") { + if arg.starts_with('+') { validate_time_format(&arg).map_err(|err| err.description().to_string()) } else if &arg == "date" { Result::Ok(()) diff --git a/src/flags.rs b/src/flags.rs index 900fe58..d8e8c43 100644 --- a/src/flags.rs +++ b/src/flags.rs @@ -260,7 +260,7 @@ impl<'a> From<&'a str> for DateFlag { match time { "date" => DateFlag::Date, "relative" => DateFlag::Relative, - time if time.starts_with("+") => DateFlag::Formatted(time[1..].to_owned()), + time if time.starts_with('+') => DateFlag::Formatted(time[1..].to_owned()), _ => panic!("invalid \"time\" flag: {}", time), } } |