Refactor to use new helper function
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
parent
92a0713ed0
commit
3da1d9e1d9
1 changed files with 2 additions and 7 deletions
|
@ -75,12 +75,7 @@ fn try_to_parse_datetime(s: &str) -> Result<NaiveDateTime> {
|
|||
"%Y%m%dT%H%M%SZ"
|
||||
];
|
||||
|
||||
for format in FORMATS {
|
||||
if let Ok(parsed) = NaiveDateTime::parse_from_str(s, format) {
|
||||
return Ok(parsed);
|
||||
}
|
||||
}
|
||||
|
||||
Err(format_err!("Cannot parse datetime: {}", s))
|
||||
::libimagutil::date::try_to_parse_datetime_from_string(s, FORMATS.iter())
|
||||
.ok_or_else(|| format_err!("Cannot parse datetime: {}", s))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue