clippy::redundant_closure_for_method_calls

This commit is contained in:
gwenn 2022-01-05 19:30:17 +01:00 committed by Thom Chiovoloni
parent 48975e015f
commit b5aa6f7984
2 changed files with 3 additions and 3 deletions

View File

@ -177,7 +177,7 @@ impl FromSql for std::sync::Arc<str> {
impl FromSql for Vec<u8> { impl FromSql for Vec<u8> {
#[inline] #[inline]
fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> { fn column_result(value: ValueRef<'_>) -> FromSqlResult<Self> {
value.as_blob().map(|b| b.to_vec()) value.as_blob().map(<[u8]>::to_vec)
} }
} }

View File

@ -47,7 +47,7 @@ impl FromSql for OffsetDateTime {
len if len <= 19 => { len if len <= 19 => {
// TODO YYYY-MM-DDTHH:MM:SS // TODO YYYY-MM-DDTHH:MM:SS
PrimitiveDateTime::parse(s, &PRIMITIVE_SHORT_DATE_TIME_FORMAT) PrimitiveDateTime::parse(s, &PRIMITIVE_SHORT_DATE_TIME_FORMAT)
.map(|d| d.assume_utc()) .map(PrimitiveDateTime::assume_utc)
} }
_ if s.as_bytes()[19] == b':' => { _ if s.as_bytes()[19] == b':' => {
// legacy // legacy
@ -56,7 +56,7 @@ impl FromSql for OffsetDateTime {
_ if s.as_bytes()[19] == b'.' => OffsetDateTime::parse(s, &OFFSET_DATE_TIME_FORMAT) _ if s.as_bytes()[19] == b'.' => OffsetDateTime::parse(s, &OFFSET_DATE_TIME_FORMAT)
.or_else(|err| { .or_else(|err| {
PrimitiveDateTime::parse(s, &PRIMITIVE_DATE_TIME_FORMAT) PrimitiveDateTime::parse(s, &PRIMITIVE_DATE_TIME_FORMAT)
.map(|d| d.assume_utc()) .map(PrimitiveDateTime::assume_utc)
.map_err(|_| err) .map_err(|_| err)
}), }),
_ => OffsetDateTime::parse(s, &OFFSET_SHORT_DATE_TIME_FORMAT), _ => OffsetDateTime::parse(s, &OFFSET_SHORT_DATE_TIME_FORMAT),