File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 10
10
#![ crate_name = "util" ]
11
11
#![ no_std]
12
12
13
- #![ feature( zero_one ) ]
13
+ #![ feature( step_trait ) ]
14
14
// #[cfg(not(test))] extern crate vga;
15
15
16
- use core:: { fmt, ops, num } ;
16
+ use core:: { fmt, ops} ;
17
17
use ops:: * ;
18
- use num:: One ;
18
+ use core:: iter:: Step ;
19
+ // use core::num::One;
19
20
20
21
pub mod io;
21
22
@@ -29,16 +30,17 @@ impl fmt::Debug for Void {
29
30
}
30
31
}
31
32
32
- pub trait Align : Sized + Copy + One
33
+ pub trait Align : Sized + Copy // + One
33
34
+ Add < Output =Self > + Sub < Output =Self >
34
35
+ BitAnd < Output =Self > + Not < Output =Self >
36
+ + Step
35
37
{
36
38
#[ inline] fn align_up ( & self , to : Self ) -> Self {
37
- let align = to - One :: one ( ) ;
39
+ let align = to. sub_one ( ) ;
38
40
( * self + align) & !align
39
41
}
40
42
#[ inline] fn align_down ( & self , to : Self ) -> Self {
41
- * self & !( to - One :: one ( ) )
43
+ * self & !to . sub_one ( )
42
44
}
43
45
}
44
46
You can’t perform that action at this time.
0 commit comments