Skip to content

Commit 21fdfe8

Browse files
committed
Use map instead of ?
1 parent d61eef2 commit 21fdfe8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

postgres-types/src/smol_str_02.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::{FromSql, IsNull, ToSql, Type};
66

77
impl<'a> FromSql<'a> for SmolStr {
88
fn from_sql(ty: &Type, raw: &'a [u8]) -> Result<Self, Box<dyn Error + Sync + Send>> {
9-
Ok(SmolStr::new(<&str as FromSql>::from_sql(ty, raw)?))
9+
<&str as FromSql>::from_sql(ty, raw).map(SmolStr::new)
1010
}
1111

1212
fn accepts(ty: &Type) -> bool {

0 commit comments

Comments
 (0)