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:
Tobin C. Harding 2023-01-20 11:17:10 +11:00
parent 7e85452cd9
commit 5ab5c264d2
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
9 changed files with 10 additions and 10 deletions

View File

@ -24,7 +24,7 @@ use core::str;
use core::ops::Index;
use core::slice::SliceIndex;
use crate::{Error, hex, ripemd160, sha256};
use crate::{Error, ripemd160, sha256};
crate::internal_macros::hash_type! {
160,

View File

@ -87,9 +87,9 @@ macro_rules! hash_trait_impls {
}
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> {
hex::FromHex::from_hex(s)
$crate::hex::FromHex::from_hex(s)
}
}

View File

@ -25,7 +25,7 @@ use core::convert::TryInto;
use core::ops::Index;
use core::slice::SliceIndex;
use crate::{Error, HashEngine as _, hex};
use crate::{Error, HashEngine as _};
crate::internal_macros::hash_type! {
160,

View File

@ -20,7 +20,7 @@ use core::convert::TryInto;
use core::ops::Index;
use core::slice::SliceIndex;
use crate::{Error, HashEngine as _, hex};
use crate::{Error, HashEngine as _};
crate::internal_macros::hash_type! {
160,

View File

@ -19,7 +19,7 @@ use core::str;
use core::ops::Index;
use core::slice::SliceIndex;
use crate::{Error, hex, sha256};
use crate::{Error, sha256};
crate::internal_macros::hash_type! {
256,

View File

@ -20,7 +20,7 @@ use core::marker::PhantomData;
use core::ops::Index;
use core::slice::SliceIndex;
use crate::{Error, hex, sha256};
use crate::{Error, sha256};
type HashEngine = sha256::HashEngine;

View File

@ -25,7 +25,7 @@ use core::convert::TryInto;
use core::ops::Index;
use core::slice::SliceIndex;
use crate::{Error, HashEngine as _, hex};
use crate::{Error, HashEngine as _};
crate::internal_macros::hash_trait_impls!(512, false);

View File

@ -28,7 +28,7 @@ use core::str;
use core::ops::Index;
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.
///

View File

@ -24,7 +24,7 @@ use core::{cmp, mem, ptr, str};
use core::ops::Index;
use core::slice::SliceIndex;
use crate::{Error, Hash as _, HashEngine as _, hex};
use crate::{Error, Hash as _, HashEngine as _};
crate::internal_macros::hash_type! {
64,