File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,7 @@ pub use lib::marker::PhantomData;
14
14
pub use lib:: option:: Option :: { self , None , Some } ;
15
15
pub use lib:: result:: Result :: { self , Ok , Err } ;
16
16
17
- pub use self :: string:: from_utf8_lossy;
18
- pub use self :: string:: from_int;
19
- pub use self :: string:: from_bool;
17
+ pub use self :: string:: { from_utf8_lossy, from_int, from_bool} ;
20
18
21
19
mod string {
22
20
use lib:: * ;
@@ -55,9 +53,11 @@ mod string {
55
53
56
54
#[ cfg( not( any( feature = "std" , feature = "alloc" ) ) ) ]
57
55
pub fn from_int ( i : u64 ) -> [ u8 ; 20 ] {
58
- let buf = [ 0 ; 20 ] ;
59
- let wrap = Wrapper { buf : & buf } ;
60
- write ! ( wrap, "{}" , i) ;
56
+ // len(str(1<<64)) = 20
57
+ let mut buf = [ 0 ; 20 ] ;
58
+ let wrap = Wrapper { buf : & mut buf } ;
59
+ use fmt:: Write ;
60
+ write ! ( wrap, "{}" , i) . ok ( ) ;
61
61
buf
62
62
}
63
63
You can’t perform that action at this time.
0 commit comments