mirror of
https://github.com/isar/rusqlite.git
synced 2024-11-22 15:59:58 +08:00
clippy::redundant_closure_for_method_calls
This commit is contained in:
parent
48975e015f
commit
b5aa6f7984
@ -177,7 +177,7 @@ impl FromSql for std::sync::Arc<str> {
|
||||
impl FromSql for Vec<u8> {
|
||||
#[inline]
|
||||
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
|
||||
value.as_blob().map(|b| b.to_vec())
|
||||
value.as_blob().map(<[u8]>::to_vec)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ impl FromSql for OffsetDateTime {
|
||||
len if len <= 19 => {
|
||||
// TODO YYYY-MM-DDTHH:MM:SS
|
||||
PrimitiveDateTime::parse(s, &PRIMITIVE_SHORT_DATE_TIME_FORMAT)
|
||||
.map(|d| d.assume_utc())
|
||||
.map(PrimitiveDateTime::assume_utc)
|
||||
}
|
||||
_ if s.as_bytes()[19] == b':' => {
|
||||
// legacy
|
||||
@ -56,7 +56,7 @@ impl FromSql for OffsetDateTime {
|
||||
_ if s.as_bytes()[19] == b'.' => OffsetDateTime::parse(s, &OFFSET_DATE_TIME_FORMAT)
|
||||
.or_else(|err| {
|
||||
PrimitiveDateTime::parse(s, &PRIMITIVE_DATE_TIME_FORMAT)
|
||||
.map(|d| d.assume_utc())
|
||||
.map(PrimitiveDateTime::assume_utc)
|
||||
.map_err(|_| err)
|
||||
}),
|
||||
_ => OffsetDateTime::parse(s, &OFFSET_SHORT_DATE_TIME_FORMAT),
|
||||
|
Loading…
Reference in New Issue
Block a user