diff --git a/crates/oxidetalis_core/src/types/impl_sea_orm.rs b/crates/oxidetalis_core/src/types/impl_sea_orm.rs index c5bc1e4..8d6f7c5 100644 --- a/crates/oxidetalis_core/src/types/impl_sea_orm.rs +++ b/crates/oxidetalis_core/src/types/impl_sea_orm.rs @@ -44,24 +44,20 @@ impl From for Value { impl TryGetable for PublicKey { fn try_get_by(res: &QueryResult, idx: I) -> Result { - ::try_get_by(res, idx) - .map(|v| { - PublicKey::from_str(&v) - .map_err(|err| TryGetError::DbErr(DbErr::Type(err.to_string()))) - }) - .and_then(|res| res) + ::try_get_by(res, idx).and_then(|v| { + PublicKey::from_str(&v).map_err(|err| TryGetError::DbErr(DbErr::Type(err.to_string()))) + }) } } impl ValueType for PublicKey { fn try_from(v: Value) -> Result { ::try_from(v) - .map(|v| PublicKey::from_str(&v).map_err(|_| ValueTypeErr)) - .and_then(|res| res) + .and_then(|v| PublicKey::from_str(&v).map_err(|_| ValueTypeErr)) } fn type_name() -> String { - stringify!(PublicKey).to_owned() + String::from("PublicKey") } fn array_type() -> ArrayType {