diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-07-27 14:54:34 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-07-27 15:11:22 -0700 |
| commit | 2407373fa494c9043eba633675c4a2a89769d1b2 (patch) | |
| tree | 60bfba52a784eafa4f1b09656ff0ef6796e2e058 /src/libcore/uint-template.rs | |
| parent | 01e2471cb7bc7f84863bdb0d67cfa2af16d54f9e (diff) | |
core: Make #fmt pure
Diffstat (limited to 'src/libcore/uint-template.rs')
| -rw-r--r-- | src/libcore/uint-template.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/uint-template.rs b/src/libcore/uint-template.rs index 9561ed4e65f..3a420d103a3 100644 --- a/src/libcore/uint-template.rs +++ b/src/libcore/uint-template.rs @@ -159,7 +159,7 @@ fn from_str_radix(buf: ~str, radix: u64) -> option<u64> { * * Fails if `radix` < 2 or `radix` > 16 */ -fn to_str(num: T, radix: uint) -> ~str { +pure fn to_str(num: T, radix: uint) -> ~str { do to_str_bytes(false, num, radix) |slice| { do vec::as_buf(slice) |p, len| { unsafe { str::unsafe::from_buf_len(p, len) } @@ -168,7 +168,7 @@ fn to_str(num: T, radix: uint) -> ~str { } /// Low-level helper routine for string conversion. -fn to_str_bytes<U>(neg: bool, num: T, radix: uint, +pure fn to_str_bytes<U>(neg: bool, num: T, radix: uint, f: fn(v: &[u8]) -> U) -> U { #[inline(always)] |
