mirror of
https://github.com/isar/rusqlite.git
synced 2025-08-28 09:12:21 +08:00
Fix clippy warnings
And fix bench.
This commit is contained in:
@@ -104,9 +104,8 @@ impl FromSql for DateTime<UTC> {
|
||||
Cow::Borrowed(s)
|
||||
};
|
||||
|
||||
match DateTime::parse_from_rfc3339(&s) {
|
||||
Ok(dt) => return Ok(dt.with_timezone(&UTC)),
|
||||
Err(_) => (),
|
||||
if let Ok(dt) = DateTime::parse_from_rfc3339(&s) {
|
||||
return Ok(dt.with_timezone(&UTC));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -17,8 +17,8 @@ impl ToSql for Value {
|
||||
impl FromSql for Value {
|
||||
fn column_result(value: ValueRef) -> FromSqlResult<Self> {
|
||||
match value {
|
||||
ValueRef::Text(ref s) => serde_json::from_str(s),
|
||||
ValueRef::Blob(ref b) => serde_json::from_slice(b),
|
||||
ValueRef::Text(s) => serde_json::from_str(s),
|
||||
ValueRef::Blob(b) => serde_json::from_slice(b),
|
||||
_ => return Err(FromSqlError::InvalidType),
|
||||
}
|
||||
.map_err(|err| FromSqlError::Other(Box::new(err)))
|
||||
|
Reference in New Issue
Block a user