14
14
15
15
#![ no_std]
16
16
17
- mod lib {
18
- pub use core;
19
- }
20
-
21
17
mod conversion;
22
18
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:: {
24
23
BitAnd , BitAndAssign , BitOr , BitOrAssign , BitXor , BitXorAssign , Not , Shl , ShlAssign , Shr ,
25
24
ShrAssign ,
26
25
} ;
27
26
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
-
34
27
macro_rules! define_unsigned {
35
28
( $name: ident, $bits: expr, $type: ident) => { define_unsigned!( #[ doc="" ] , $name, $bits, $type) ; } ;
36
29
( #[ $doc: meta] , $name: ident, $bits: expr, $type: ident) => {
@@ -185,31 +178,31 @@ macro_rules! implement_common {
185
178
186
179
// Implement formating functions
187
180
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 > {
189
182
let & $name( ref value) = self ;
190
183
<$type as Display >:: fmt( value, f)
191
184
}
192
185
}
193
186
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 > {
195
188
let & $name( ref value) = self ;
196
189
<$type as UpperHex >:: fmt( value, f)
197
190
}
198
191
}
199
192
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 > {
201
194
let & $name( ref value) = self ;
202
195
<$type as LowerHex >:: fmt( value, f)
203
196
}
204
197
}
205
198
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 > {
207
200
let & $name( ref value) = self ;
208
201
<$type as Octal >:: fmt( value, f)
209
202
}
210
203
}
211
204
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 > {
213
206
let & $name( ref value) = self ;
214
207
<$type as Binary >:: fmt( value, f)
215
208
}
@@ -390,7 +383,7 @@ macro_rules! implement_common {
390
383
}
391
384
}
392
385
393
- impl lib :: core:: ops:: Add <$name> for $name {
386
+ impl core:: ops:: Add <$name> for $name {
394
387
type Output = $name;
395
388
#[ allow( unused_comparisons) ]
396
389
fn add( self , other: $name) -> $name {
@@ -403,7 +396,7 @@ macro_rules! implement_common {
403
396
}
404
397
}
405
398
406
- impl lib :: core:: ops:: Sub <$name> for $name {
399
+ impl core:: ops:: Sub <$name> for $name {
407
400
type Output = $name;
408
401
#[ allow( unused_comparisons) ]
409
402
fn sub( self , other: $name) -> $name {
0 commit comments