mirror of
https://github.com/lsd-rs/lsd
synced 2024-12-14 14:12:31 +00:00
squeeze if-branches in date validation method
This commit is contained in:
parent
58d44a6450
commit
f1fed05413
1 changed files with 2 additions and 7 deletions
|
@ -208,15 +208,10 @@ fn validate_date_argument(arg: String) -> Result<(), String> {
|
|||
use std::error::Error;
|
||||
if arg.starts_with('+') {
|
||||
validate_time_format(&arg).map_err(|err| err.description().to_string())
|
||||
} else if &arg == "date" {
|
||||
Result::Ok(())
|
||||
} else if &arg == "relative" {
|
||||
} else if &arg == "date" || &arg == "relative" {
|
||||
Result::Ok(())
|
||||
} else {
|
||||
Result::Err(
|
||||
"possible values: date, relative, +date-time-format"
|
||||
.to_owned()
|
||||
)
|
||||
Result::Err("possible values: date, relative, +date-time-format".to_owned())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue