Skip to content

Commit

Permalink
Use fully qualified path in macro
Browse files Browse the repository at this point in the history
As we do for the rest of the macros use the fully qualified path to
`fmt` so users of the macro do not have to import it.
  • Loading branch information
tcharding committed May 19, 2022
1 parent 50d9394 commit 71bf196
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/internal_macros.rs
Expand Up @@ -84,7 +84,7 @@ macro_rules! impl_array_newtype {
pub fn into_bytes(self) -> [$ty; $len] { self.0 }
}

impl<'a> ::core::convert::From<&'a [$ty]> for $thing {
impl<'a> core::convert::From<&'a [$ty]> for $thing {
fn from(data: &'a [$ty]) -> $thing {
assert_eq!(data.len(), $len);
let mut ret = [0; $len];
Expand All @@ -109,7 +109,7 @@ macro_rules! impl_array_newtype {

macro_rules! display_from_debug {
($thing:ident) => {
impl ::core::fmt::Display for $thing {
impl core::fmt::Display for $thing {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> Result<(), ::core::fmt::Error> {
::core::fmt::Debug::fmt(self, f)
}
Expand Down Expand Up @@ -365,13 +365,13 @@ macro_rules! impl_bytes_newtype {

impl ::core::fmt::Display for $t {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
fmt::LowerHex::fmt(self, f)
::core::fmt::LowerHex::fmt(self, f)
}
}

impl ::core::fmt::Debug for $t {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
fmt::LowerHex::fmt(self, f)
::core::fmt::LowerHex::fmt(self, f)
}
}

Expand Down

0 comments on commit 71bf196

Please sign in to comment.