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

Commit

Permalink
don't export core
Browse files Browse the repository at this point in the history
  • Loading branch information
RCasatta committed Apr 27, 2021
1 parent 9e4c272 commit 1b36c27
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#![cfg_attr(all(test, feature = "unstable"), feature(test))]
#[cfg(all(test, feature = "unstable"))] extern crate test;

#[cfg(any(test, feature="std"))] pub extern crate core;
#[cfg(any(test, feature="std"))] extern crate core;
#[cfg(feature="serde")] pub extern crate serde;
#[cfg(all(test,feature="serde"))] extern crate serde_test;

Expand Down
28 changes: 14 additions & 14 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ macro_rules! hex_fmt_impl(
hex_fmt_impl!($imp, $ty, );
);
($imp:ident, $ty:ident, $($gen:ident: $gent:ident),*) => (
impl<$($gen: $gent),*> $crate::core::fmt::$imp for $ty<$($gen),*> {
fn fmt(&self, f: &mut $crate::core::fmt::Formatter) -> $crate::core::fmt::Result {
impl<$($gen: $gent),*> ::core::fmt::$imp for $ty<$($gen),*> {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
use $crate::hex::{format_hex, format_hex_reverse};
if $ty::<$($gen),*>::DISPLAY_BACKWARD {
format_hex_reverse(&self.0, f)
Expand All @@ -49,37 +49,37 @@ macro_rules! index_impl(
index_impl!($ty, );
);
($ty:ident, $($gen:ident: $gent:ident),*) => (
impl<$($gen: $gent),*> $crate::core::ops::Index<usize> for $ty<$($gen),*> {
impl<$($gen: $gent),*> ::core::ops::Index<usize> for $ty<$($gen),*> {
type Output = u8;
fn index(&self, index: usize) -> &u8 {
&self.0[index]
}
}

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

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

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

impl<$($gen: $gent),*> $crate::core::ops::Index<$crate::core::ops::RangeFull> for $ty<$($gen),*> {
impl<$($gen: $gent),*> ::core::ops::Index<::core::ops::RangeFull> for $ty<$($gen),*> {
type Output = [u8];
fn index(&self, index: $crate::core::ops::RangeFull) -> &[u8] {
fn index(&self, index: ::core::ops::RangeFull) -> &[u8] {
&self.0[index]
}
}
Expand All @@ -93,19 +93,19 @@ macro_rules! borrow_slice_impl(
borrow_slice_impl!($ty, );
);
($ty:ident, $($gen:ident: $gent:ident),*) => (
impl<$($gen: $gent),*> $crate::core::borrow::Borrow<[u8]> for $ty<$($gen),*> {
impl<$($gen: $gent),*> ::core::borrow::Borrow<[u8]> for $ty<$($gen),*> {
fn borrow(&self) -> &[u8] {
&self[..]
}
}

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

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

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

0 comments on commit 1b36c27

Please sign in to comment.