change string literal into char literal

This commit is contained in:
dvvvvvv 2019-11-10 16:56:33 +09:00 committed by Abin Simon
parent e6ee773277
commit 58d44a6450
2 changed files with 2 additions and 2 deletions

View file

@ -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(())

View file

@ -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),
}
}