Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 43cc8eb

Browse files
committed
removes $crate from hash_newtype! macro
1 parent be39229 commit 43cc8eb

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

embedded/src/main.rs

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use panic_halt as _; // you can put a breakpoint on `rust_begin_unwind` to catch
1313
use cortex_m_rt::entry;
1414
use cortex_m_semihosting::{debug, hprintln};
1515
use bitcoin_hashes::sha256;
16-
use core::str::FromStr;
1716
use bitcoin_hashes::Hash;
1817

1918
hash_newtype!(TestType, sha256::Hash, 32, doc="test");

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#![cfg_attr(all(test, feature = "unstable"), feature(test))]
3838
#[cfg(all(test, feature = "unstable"))] extern crate test;
3939

40-
#[cfg(any(test, feature="std"))] pub extern crate core;
40+
#[cfg(any(test, feature="std"))] extern crate core;
4141
#[cfg(feature="serde")] pub extern crate serde;
4242
#[cfg(all(test,feature="serde"))] extern crate serde_test;
4343

src/util.rs

+14-14
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ macro_rules! hex_fmt_impl(
2929
hex_fmt_impl!($imp, $ty, );
3030
);
3131
($imp:ident, $ty:ident, $($gen:ident: $gent:ident),*) => (
32-
impl<$($gen: $gent),*> $crate::core::fmt::$imp for $ty<$($gen),*> {
33-
fn fmt(&self, f: &mut $crate::core::fmt::Formatter) -> $crate::core::fmt::Result {
32+
impl<$($gen: $gent),*> ::core::fmt::$imp for $ty<$($gen),*> {
33+
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
3434
use $crate::hex::{format_hex, format_hex_reverse};
3535
if $ty::<$($gen),*>::DISPLAY_BACKWARD {
3636
format_hex_reverse(&self.0, f)
@@ -49,37 +49,37 @@ macro_rules! index_impl(
4949
index_impl!($ty, );
5050
);
5151
($ty:ident, $($gen:ident: $gent:ident),*) => (
52-
impl<$($gen: $gent),*> $crate::core::ops::Index<usize> for $ty<$($gen),*> {
52+
impl<$($gen: $gent),*> ::core::ops::Index<usize> for $ty<$($gen),*> {
5353
type Output = u8;
5454
fn index(&self, index: usize) -> &u8 {
5555
&self.0[index]
5656
}
5757
}
5858

59-
impl<$($gen: $gent),*> $crate::core::ops::Index<$crate::core::ops::Range<usize>> for $ty<$($gen),*> {
59+
impl<$($gen: $gent),*> ::core::ops::Index<::core::ops::Range<usize>> for $ty<$($gen),*> {
6060
type Output = [u8];
61-
fn index(&self, index: $crate::core::ops::Range<usize>) -> &[u8] {
61+
fn index(&self, index: ::core::ops::Range<usize>) -> &[u8] {
6262
&self.0[index]
6363
}
6464
}
6565

66-
impl<$($gen: $gent),*> $crate::core::ops::Index<$crate::core::ops::RangeFrom<usize>> for $ty<$($gen),*> {
66+
impl<$($gen: $gent),*> ::core::ops::Index<::core::ops::RangeFrom<usize>> for $ty<$($gen),*> {
6767
type Output = [u8];
68-
fn index(&self, index: $crate::core::ops::RangeFrom<usize>) -> &[u8] {
68+
fn index(&self, index: ::core::ops::RangeFrom<usize>) -> &[u8] {
6969
&self.0[index]
7070
}
7171
}
7272

73-
impl<$($gen: $gent),*> $crate::core::ops::Index<$crate::core::ops::RangeTo<usize>> for $ty<$($gen),*> {
73+
impl<$($gen: $gent),*> ::core::ops::Index<::core::ops::RangeTo<usize>> for $ty<$($gen),*> {
7474
type Output = [u8];
75-
fn index(&self, index: $crate::core::ops::RangeTo<usize>) -> &[u8] {
75+
fn index(&self, index: ::core::ops::RangeTo<usize>) -> &[u8] {
7676
&self.0[index]
7777
}
7878
}
7979

80-
impl<$($gen: $gent),*> $crate::core::ops::Index<$crate::core::ops::RangeFull> for $ty<$($gen),*> {
80+
impl<$($gen: $gent),*> ::core::ops::Index<::core::ops::RangeFull> for $ty<$($gen),*> {
8181
type Output = [u8];
82-
fn index(&self, index: $crate::core::ops::RangeFull) -> &[u8] {
82+
fn index(&self, index: ::core::ops::RangeFull) -> &[u8] {
8383
&self.0[index]
8484
}
8585
}
@@ -93,19 +93,19 @@ macro_rules! borrow_slice_impl(
9393
borrow_slice_impl!($ty, );
9494
);
9595
($ty:ident, $($gen:ident: $gent:ident),*) => (
96-
impl<$($gen: $gent),*> $crate::core::borrow::Borrow<[u8]> for $ty<$($gen),*> {
96+
impl<$($gen: $gent),*> ::core::borrow::Borrow<[u8]> for $ty<$($gen),*> {
9797
fn borrow(&self) -> &[u8] {
9898
&self[..]
9999
}
100100
}
101101

102-
impl<$($gen: $gent),*> $crate::core::convert::AsRef<[u8]> for $ty<$($gen),*> {
102+
impl<$($gen: $gent),*> ::core::convert::AsRef<[u8]> for $ty<$($gen),*> {
103103
fn as_ref(&self) -> &[u8] {
104104
&self[..]
105105
}
106106
}
107107

108-
impl<$($gen: $gent),*> $crate::core::ops::Deref for $ty<$($gen),*> {
108+
impl<$($gen: $gent),*> ::core::ops::Deref for $ty<$($gen),*> {
109109
type Target = [u8];
110110

111111
fn deref(&self) -> &Self::Target {

0 commit comments

Comments
 (0)