Merge pull request #772 from gwenn/clippy

Clippy
This commit is contained in:
gwenn 2020-06-27 07:18:39 +02:00 committed by GitHub
commit 0b948d83da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,10 +23,10 @@ impl FromSql for time::Timespec {
match s.len() { match s.len() {
19 => time::strptime(s, CURRENT_TIMESTAMP_FMT), 19 => time::strptime(s, CURRENT_TIMESTAMP_FMT),
_ => time::strptime(s, SQLITE_DATETIME_FMT).or_else(|err| { _ => time::strptime(s, SQLITE_DATETIME_FMT).or_else(|err| {
time::strptime(s, SQLITE_DATETIME_FMT_LEGACY).or_else(|_| Err(err)) time::strptime(s, SQLITE_DATETIME_FMT_LEGACY).map_err(|_| err)
}), }),
} }
.or_else(|err| Err(FromSqlError::Other(Box::new(err)))) .map_err(|err| FromSqlError::Other(Box::new(err)))
}) })
.map(|tm| tm.to_timespec()) .map(|tm| tm.to_timespec())
} }