From dd0bfe03eba88ce789590dee6cfa487b1157c362 Mon Sep 17 00:00:00 2001 From: Yago Iglesias Date: Mon, 18 Mar 2024 18:13:59 +0100 Subject: [PATCH] fix: Use `::std` instead of `std` This fixes potential issues with the `std` module being shadowed by a local module. --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 3d7046a..ee19d4f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -121,7 +121,7 @@ mod attributes; /// Two, /// } /// -/// impl std::fmt::Display for Numbers { +/// impl ::std::fmt::Display for Numbers { /// fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { /// match self { /// Self::One => write!(f, "One"), @@ -150,7 +150,7 @@ mod attributes; /// } /// } /// -/// impl std::str::FromStr for Numbers { +/// impl ::std::str::FromStr for Numbers { /// type Err = (); /// /// fn from_str(s: &str) -> Result { @@ -189,7 +189,7 @@ fn impl_display( names: &Vec, ) -> TokenStream { let gen = quote! { - impl std::fmt::Display for #name { + impl ::std::fmt::Display for #name { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { match self { #(Self::#identifiers=> write!(f, stringify!(#names))),* @@ -241,7 +241,7 @@ fn impl_from_string(name: &syn::Ident) -> TokenStream { /// Implementation of [`std::str::FromStr`]. fn impl_from_str_trait(name: &syn::Ident) -> TokenStream { let gen = quote! { - impl std::str::FromStr for #name { + impl ::std::str::FromStr for #name { type Err = (); fn from_str(s: &str) -> Result {