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

Commit 2fe89ce

Browse files
committed
removes because ::core is private when used from no_std
1 parent be39229 commit 2fe89ce

File tree

2 files changed

+16
-14
lines changed

2 files changed

+16
-14
lines changed

.github/workflows/rust.yml

+2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ jobs:
6161
matrix:
6262
rust:
6363
- 1.29.0
64+
- 1.31.0
6465
- beta
6566
- stable
67+
fail-fast: false
6668
steps:
6769
- name: Checkout Crate
6870
uses: actions/checkout@v2

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)