Skip to content

Commit

Permalink
fix: Use full path of Result type
Browse files Browse the repository at this point in the history
Fixes #905
  • Loading branch information
anstylian committed Sep 7, 2023
1 parent 30c800d commit 16e7e35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions prost-derive/src/field/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,14 +276,14 @@ impl Field {
#[doc=#get_doc]
pub fn #get(&self, key: #key_ref_ty) -> ::core::option::Option<#ty> {
self.#ident.get(#take_ref key).cloned().and_then(|x| {
let result: Result<#ty, _> = ::core::convert::TryFrom::try_from(x);
let result: ::core::result::Result<#ty, _> = ::core::convert::TryFrom::try_from(x);
result.ok()
})
}
#[doc=#insert_doc]
pub fn #insert(&mut self, key: #key_ty, value: #ty) -> ::core::option::Option<#ty> {
self.#ident.insert(key, value as i32).and_then(|x| {
let result: Result<#ty, _> = ::core::convert::TryFrom::try_from(x);
let result: ::core::result::Result<#ty, _> = ::core::convert::TryFrom::try_from(x);
result.ok()
})
}
Expand Down
6 changes: 3 additions & 3 deletions prost-derive/src/field/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl Field {
struct #wrap_name<'a>(&'a i32);
impl<'a> ::core::fmt::Debug for #wrap_name<'a> {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
let res: Result<#ty, _> = ::core::convert::TryFrom::try_from(*self.0);
let res: ::core::result::Result<#ty, _> = ::core::convert::TryFrom::try_from(*self.0);
match res {
Err(_) => ::core::fmt::Debug::fmt(&self.0, f),
Ok(en) => ::core::fmt::Debug::fmt(&en, f),
Expand Down Expand Up @@ -316,7 +316,7 @@ impl Field {
#[doc=#get_doc]
pub fn #get(&self) -> #ty {
self.#ident.and_then(|x| {
let result: Result<#ty, _> = ::core::convert::TryFrom::try_from(x);
let result: ::core::result::Result<#ty, _> = ::core::convert::TryFrom::try_from(x);
result.ok()
}).unwrap_or(#default)
}
Expand All @@ -341,7 +341,7 @@ impl Field {
fn(i32) -> ::core::option::Option<#ty>,
> {
self.#ident.iter().cloned().filter_map(|x| {
let result: Result<#ty, _> = ::core::convert::TryFrom::try_from(x);
let result: ::core::result::Result<#ty, _> = ::core::convert::TryFrom::try_from(x);
result.ok()
})
}
Expand Down

0 comments on commit 16e7e35

Please sign in to comment.