Skip to content

Commit

Permalink
derive: qualify Result as std::result::Result
Browse files Browse the repository at this point in the history
  • Loading branch information
blackbeam committed Apr 3, 2024
1 parent 9a37f10 commit 463a99e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
8 changes: 3 additions & 5 deletions derive/src/from_row/structs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,10 @@ impl ToTokens for GenericStruct<'_> {
let ty = &f.ty;
if attrs.json {
quote::quote!(#ident: #ident.commit().0)
} else if attrs.with.is_some() {
quote::quote!( #ident )
} else {
if attrs.with.is_some() {
quote::quote!( #ident )
} else {
quote::quote!(#ident: <<#ty as FromValue>::Intermediate as std::convert::Into<#ty>>::into(#ident))
}
quote::quote!(#ident: <<#ty as FromValue>::Intermediate as std::convert::Into<#ty>>::into(#ident))
}
})
.collect::<Vec<_>>();
Expand Down
2 changes: 1 addition & 1 deletion derive/src/from_value/enums/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ impl ToTokens for Enum {
impl std::convert::TryFrom<#crat::Value> for #ir_name {
type Error = #crat::FromValueError;

fn try_from(v: #crat::Value) -> Result<Self, Self::Error> {
fn try_from(v: #crat::Value) -> std::result::Result<Self, Self::Error> {
match v {
#( #branches )*
v => Err(#crat::FromValueError(v)),
Expand Down
8 changes: 4 additions & 4 deletions derive/src/from_value/structs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl ToTokens for NewTypeNoGenerics<'_> {
impl std::convert::TryFrom<#crat::Value> for #ir_name {
type Error = #crat::FromValueError;

fn try_from(v: #crat::Value) -> Result<Self, Self::Error> {
fn try_from(v: #crat::Value) -> std::result::Result<Self, Self::Error> {
#path(v).map(Self)
}
}
Expand Down Expand Up @@ -162,7 +162,7 @@ impl ToTokens for NewTypeNoGenerics<'_> {
impl TryFrom<Value> for #ir_name<#field_type> {
type Error = <<#field_type as FromValue>::Intermediate as TryFrom<Value>>::Error;

fn try_from(value: Value) -> Result<Self, Self::Error> {
fn try_from(value: Value) -> std::result::Result<Self, Self::Error> {
<#field_type as FromValue>::Intermediate::try_from(value).map(Self)
}
}
Expand Down Expand Up @@ -279,7 +279,7 @@ impl ToTokens for NewType<'_> {
where #additional_bounds {
type Error = #crat::FromValueError;

fn try_from(v: #crat::Value) -> Result<Self, Self::Error> {
fn try_from(v: #crat::Value) -> std::result::Result<Self, Self::Error> {
#path(v)
}
}
Expand All @@ -305,7 +305,7 @@ impl ToTokens for NewType<'_> {
{
type Error = <<#field_type as #crat::prelude::FromValue>::Intermediate as std::convert::TryFrom<#crat::Value>>::Error;

fn try_from(value: #crat::Value) -> Result<Self, Self::Error> {
fn try_from(value: #crat::Value) -> std::result::Result<Self, Self::Error> {
<#field_type as #crat::prelude::FromValue>::Intermediate::try_from(value).map(Self)
}
}
Expand Down

0 comments on commit 463a99e

Please sign in to comment.