Use fully qualified path in macro
It is easier to maintain code if macros use the fully qualified path to types and functions instead of relying on code that uses the macro to import said type or function.
This commit is contained in:
parent
7e85452cd9
commit
5ab5c264d2
|
@ -24,7 +24,7 @@ use core::str;
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
use core::slice::SliceIndex;
|
use core::slice::SliceIndex;
|
||||||
|
|
||||||
use crate::{Error, hex, ripemd160, sha256};
|
use crate::{Error, ripemd160, sha256};
|
||||||
|
|
||||||
crate::internal_macros::hash_type! {
|
crate::internal_macros::hash_type! {
|
||||||
160,
|
160,
|
||||||
|
|
|
@ -87,9 +87,9 @@ macro_rules! hash_trait_impls {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<$($gen: $gent),*> str::FromStr for Hash<$($gen),*> {
|
impl<$($gen: $gent),*> str::FromStr for Hash<$($gen),*> {
|
||||||
type Err = hex::Error;
|
type Err = $crate::hex::Error;
|
||||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||||
hex::FromHex::from_hex(s)
|
$crate::hex::FromHex::from_hex(s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ use core::convert::TryInto;
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
use core::slice::SliceIndex;
|
use core::slice::SliceIndex;
|
||||||
|
|
||||||
use crate::{Error, HashEngine as _, hex};
|
use crate::{Error, HashEngine as _};
|
||||||
|
|
||||||
crate::internal_macros::hash_type! {
|
crate::internal_macros::hash_type! {
|
||||||
160,
|
160,
|
||||||
|
|
|
@ -20,7 +20,7 @@ use core::convert::TryInto;
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
use core::slice::SliceIndex;
|
use core::slice::SliceIndex;
|
||||||
|
|
||||||
use crate::{Error, HashEngine as _, hex};
|
use crate::{Error, HashEngine as _};
|
||||||
|
|
||||||
crate::internal_macros::hash_type! {
|
crate::internal_macros::hash_type! {
|
||||||
160,
|
160,
|
||||||
|
|
|
@ -19,7 +19,7 @@ use core::str;
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
use core::slice::SliceIndex;
|
use core::slice::SliceIndex;
|
||||||
|
|
||||||
use crate::{Error, hex, sha256};
|
use crate::{Error, sha256};
|
||||||
|
|
||||||
crate::internal_macros::hash_type! {
|
crate::internal_macros::hash_type! {
|
||||||
256,
|
256,
|
||||||
|
|
|
@ -20,7 +20,7 @@ use core::marker::PhantomData;
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
use core::slice::SliceIndex;
|
use core::slice::SliceIndex;
|
||||||
|
|
||||||
use crate::{Error, hex, sha256};
|
use crate::{Error, sha256};
|
||||||
|
|
||||||
type HashEngine = sha256::HashEngine;
|
type HashEngine = sha256::HashEngine;
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ use core::convert::TryInto;
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
use core::slice::SliceIndex;
|
use core::slice::SliceIndex;
|
||||||
|
|
||||||
use crate::{Error, HashEngine as _, hex};
|
use crate::{Error, HashEngine as _};
|
||||||
|
|
||||||
crate::internal_macros::hash_trait_impls!(512, false);
|
crate::internal_macros::hash_trait_impls!(512, false);
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ use core::str;
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
use core::slice::SliceIndex;
|
use core::slice::SliceIndex;
|
||||||
|
|
||||||
use crate::{hex, sha512, sha512::BLOCK_SIZE, Error};
|
use crate::{sha512, sha512::BLOCK_SIZE, Error};
|
||||||
|
|
||||||
/// Engine to compute SHA512/256 hash function.
|
/// Engine to compute SHA512/256 hash function.
|
||||||
///
|
///
|
||||||
|
|
|
@ -24,7 +24,7 @@ use core::{cmp, mem, ptr, str};
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
use core::slice::SliceIndex;
|
use core::slice::SliceIndex;
|
||||||
|
|
||||||
use crate::{Error, Hash as _, HashEngine as _, hex};
|
use crate::{Error, Hash as _, HashEngine as _};
|
||||||
|
|
||||||
crate::internal_macros::hash_type! {
|
crate::internal_macros::hash_type! {
|
||||||
64,
|
64,
|
||||||
|
|
Loading…
Reference in New Issue