File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5
- refs/heads/try: a542258277aac84889ed7eb3c2f14273d6d5e3f7
5
+ refs/heads/try: 5f904d278fa3cc8993bd961dea93d99a34e2f3c2
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
Original file line number Diff line number Diff line change @@ -89,11 +89,12 @@ fn parse_buf(buf: [u8], radix: uint) -> option<T> {
89
89
fn from_str ( s : str ) -> option < T > { parse_buf ( str:: bytes ( s) , 10 u) }
90
90
91
91
#[ doc = "Convert to a string in a given base" ]
92
- fn to_str ( n : T , radix : uint ) -> str {
93
- assert ( 0 u < radix && radix <= 16 u) ;
94
- ret if n < 0 as T {
95
- "-" + uint:: to_str ( -n as uint , radix)
96
- } else { uint:: to_str ( n as uint , radix) } ;
92
+ fn to_str ( n : T , radix : uint ) -> str unsafe {
93
+ to_str_bytes ( n, radix) { |slice|
94
+ vec:: unpack_slice ( slice) { |p, len|
95
+ str:: unsafe:: from_buf_len ( p, len)
96
+ }
97
+ }
97
98
}
98
99
99
100
fn to_str_bytes < U > ( n : T , radix : uint , f : fn ( [ u8] /& ) -> U ) -> U {
You can’t perform that action at this time.
0 commit comments