From 885d8215da741b78e28fecc68937d2fb978c56a5 Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sun, 10 May 2026 01:25:16 +0200 Subject: [PATCH] fix: use fully qualified imports for Result --- src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index f14ec3f..073672b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -178,7 +178,7 @@ //! impl TryFrom<&str> for Numbers { //! type Error = String; //! -//! fn try_from(s: &str) -> Result { +//! fn try_from(s: &str) -> std::result::Result { //! match s { //! "One" => Ok(Self::One), //! "Two" => Ok(Self::Two), @@ -190,7 +190,7 @@ //! impl TryFrom for Numbers { //! type Error = String; //! -//! fn try_from(s: String) -> Result { +//! fn try_from(s: String) -> std::result::Result { //! s.as_str().try_into() //! } //! } @@ -198,7 +198,7 @@ //! impl ::std::str::FromStr for Numbers { //! type Err = String; //! -//! fn from_str(s: &str) -> Result { +//! fn from_str(s: &str) -> std::result::Result { //! s.try_into() //! } //! } @@ -269,7 +269,7 @@ fn impl_try_from_str( impl TryFrom<&str> for #name { type Error = String; - fn try_from(s: &str) -> Result { + fn try_from(s: &str) -> std::result::Result { match s { #(#names => Ok(Self::#identifiers),)* _ => Err(format!("Failed to parse string '{}' for enum {}", s, stringify!(#name))), @@ -286,7 +286,7 @@ fn impl_try_from_string(name: &syn::Ident) -> TokenStream { impl TryFrom for #name { type Error = String; - fn try_from(s: String) -> Result { + fn try_from(s: String) -> std::result::Result { s.as_str().try_into() } } @@ -300,7 +300,7 @@ fn impl_from_str(name: &syn::Ident) -> TokenStream { impl ::std::str::FromStr for #name { type Err = String; - fn from_str(s: &str) -> Result { + fn from_str(s: &str) -> std::result::Result { s.try_into() } }