Use fully qualified path in macro
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.
This commit is contained in:
parent
50d9394582
commit
71bf19621a
|
@ -84,7 +84,7 @@ macro_rules! impl_array_newtype {
|
||||||
pub fn into_bytes(self) -> [$ty; $len] { self.0 }
|
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 {
|
fn from(data: &'a [$ty]) -> $thing {
|
||||||
assert_eq!(data.len(), $len);
|
assert_eq!(data.len(), $len);
|
||||||
let mut ret = [0; $len];
|
let mut ret = [0; $len];
|
||||||
|
@ -109,7 +109,7 @@ macro_rules! impl_array_newtype {
|
||||||
|
|
||||||
macro_rules! display_from_debug {
|
macro_rules! display_from_debug {
|
||||||
($thing:ident) => {
|
($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> {
|
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> Result<(), ::core::fmt::Error> {
|
||||||
::core::fmt::Debug::fmt(self, f)
|
::core::fmt::Debug::fmt(self, f)
|
||||||
}
|
}
|
||||||
|
@ -365,13 +365,13 @@ macro_rules! impl_bytes_newtype {
|
||||||
|
|
||||||
impl ::core::fmt::Display for $t {
|
impl ::core::fmt::Display for $t {
|
||||||
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
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 {
|
impl ::core::fmt::Debug for $t {
|
||||||
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
|
||||||
fmt::LowerHex::fmt(self, f)
|
::core::fmt::LowerHex::fmt(self, f)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue