diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-11 13:10:37 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-12 12:21:04 +1000 |
| commit | efc71a8bdb28fba88d0cc8916b33838bf43b3a8d (patch) | |
| tree | ad0086d4319facd8da21583e19a952a01250bbbd /src/libextra/num | |
| parent | ba4a4778cc17c64c33a891a0d2565a1fb04ddffc (diff) | |
| download | rust-efc71a8bdb28fba88d0cc8916b33838bf43b3a8d.tar.gz rust-efc71a8bdb28fba88d0cc8916b33838bf43b3a8d.zip | |
std: unify the str -> [u8] functions as 3 methods: .as_bytes() and .as_bytes_with_null[_consume]().
The first acts on &str and is not nul-terminated, the last two act on strings that are always null terminated (&'static str, ~str and @str).
Diffstat (limited to 'src/libextra/num')
| -rw-r--r-- | src/libextra/num/bigint.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libextra/num/bigint.rs b/src/libextra/num/bigint.rs index bd6425d779c..18ba4fb9c76 100644 --- a/src/libextra/num/bigint.rs +++ b/src/libextra/num/bigint.rs @@ -534,7 +534,7 @@ impl FromStrRadix for BigUint { pub fn from_str_radix(s: &str, radix: uint) -> Option<BigUint> { - BigUint::parse_bytes(str::to_bytes(s), radix) + BigUint::parse_bytes(s.as_bytes(), radix) } } @@ -1090,7 +1090,7 @@ impl FromStrRadix for BigInt { fn from_str_radix(s: &str, radix: uint) -> Option<BigInt> { - BigInt::parse_bytes(str::to_bytes(s), radix) + BigInt::parse_bytes(s.as_bytes(), radix) } } |
