Fix uint/u64 confusion
Causes a failure on 32-bit platforms
This commit is contained in:
@@ -122,7 +122,7 @@ fn from_str(buf: str, radix: u64) -> option<u64> {
|
|||||||
let i = str::len_bytes(buf) - 1u;
|
let i = str::len_bytes(buf) - 1u;
|
||||||
let power = 1u64, n = 0u64;
|
let power = 1u64, n = 0u64;
|
||||||
while true {
|
while true {
|
||||||
alt char::to_digit(buf[i] as char, radix) {
|
alt char::to_digit(buf[i] as char, radix as uint) {
|
||||||
some(d) { n += d as u64 * power; }
|
some(d) { n += d as u64 * power; }
|
||||||
none { ret none; }
|
none { ret none; }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user