Skip to content

Commit 0b4fb3c

Browse files
committed
Replace lib::core with core
1 parent 1081930 commit 0b4fb3c

File tree

2 files changed

+15
-22
lines changed

2 files changed

+15
-22
lines changed

src/conversion.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use crate::*;
44
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
55
pub struct TryFromIntError(pub(crate) ());
66

7-
impl From<lib::core::num::TryFromIntError> for TryFromIntError {
8-
fn from(_: lib::core::num::TryFromIntError) -> TryFromIntError {
7+
impl From<core::num::TryFromIntError> for TryFromIntError {
8+
fn from(_: core::num::TryFromIntError) -> TryFromIntError {
99
TryFromIntError(())
1010
}
1111
}
1212

13-
impl From<lib::core::convert::Infallible> for TryFromIntError {
14-
fn from(_: lib::core::convert::Infallible) -> TryFromIntError {
13+
impl From<core::convert::Infallible> for TryFromIntError {
14+
fn from(_: core::convert::Infallible) -> TryFromIntError {
1515
TryFromIntError(())
1616
}
1717
}

src/lib.rs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,16 @@
1414
1515
#![no_std]
1616

17-
mod lib {
18-
pub use core;
19-
}
20-
2117
mod conversion;
2218

23-
use lib::core::ops::{
19+
use core::cmp::{Ord, Ordering, PartialOrd};
20+
use core::fmt::{Binary, Display, Formatter, LowerHex, Octal, UpperHex};
21+
use core::hash::{Hash, Hasher};
22+
use core::ops::{
2423
BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, Not, Shl, ShlAssign, Shr,
2524
ShrAssign,
2625
};
2726

28-
use lib::core::hash::{Hash, Hasher};
29-
30-
use lib::core::cmp::{Ord, Ordering, PartialOrd};
31-
32-
use lib::core::fmt::{Binary, Display, Formatter, LowerHex, Octal, UpperHex};
33-
3427
macro_rules! define_unsigned {
3528
($name:ident, $bits:expr, $type:ident) => {define_unsigned!(#[doc=""], $name, $bits, $type);};
3629
(#[$doc:meta], $name:ident, $bits:expr, $type:ident) => {
@@ -185,31 +178,31 @@ macro_rules! implement_common {
185178

186179
// Implement formating functions
187180
impl Display for $name {
188-
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
181+
fn fmt(&self, f: &mut Formatter) -> Result<(), core::fmt::Error> {
189182
let &$name(ref value) = self;
190183
<$type as Display>::fmt(value, f)
191184
}
192185
}
193186
impl UpperHex for $name {
194-
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
187+
fn fmt(&self, f: &mut Formatter) -> Result<(), core::fmt::Error> {
195188
let &$name(ref value) = self;
196189
<$type as UpperHex>::fmt(value, f)
197190
}
198191
}
199192
impl LowerHex for $name {
200-
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
193+
fn fmt(&self, f: &mut Formatter) -> Result<(), core::fmt::Error> {
201194
let &$name(ref value) = self;
202195
<$type as LowerHex>::fmt(value, f)
203196
}
204197
}
205198
impl Octal for $name {
206-
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
199+
fn fmt(&self, f: &mut Formatter) -> Result<(), core::fmt::Error> {
207200
let &$name(ref value) = self;
208201
<$type as Octal>::fmt(value, f)
209202
}
210203
}
211204
impl Binary for $name {
212-
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
205+
fn fmt(&self, f: &mut Formatter) -> Result<(), core::fmt::Error> {
213206
let &$name(ref value) = self;
214207
<$type as Binary>::fmt(value, f)
215208
}
@@ -390,7 +383,7 @@ macro_rules! implement_common {
390383
}
391384
}
392385

393-
impl lib::core::ops::Add<$name> for $name {
386+
impl core::ops::Add<$name> for $name {
394387
type Output = $name;
395388
#[allow(unused_comparisons)]
396389
fn add(self, other: $name) -> $name {
@@ -403,7 +396,7 @@ macro_rules! implement_common {
403396
}
404397
}
405398

406-
impl lib::core::ops::Sub<$name> for $name {
399+
impl core::ops::Sub<$name> for $name {
407400
type Output = $name;
408401
#[allow(unused_comparisons)]
409402
fn sub(self, other: $name) -> $name {

0 commit comments

Comments
 (0)