about summary refs log tree commit diff
path: root/src/libstd/num/f32.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2014-05-16 10:45:16 -0700
committerPatrick Walton <pcwalton@mimiga.net>2014-05-22 14:42:01 -0700
commit36195eb91f15975fed7555a3aa52807ecd5698a1 (patch)
treed0e99310be4a24e76b8d6b13f05ec79c1f89b6ba /src/libstd/num/f32.rs
parente402e75f4eb79af09b9451f0f232f994b3e2c998 (diff)
downloadrust-36195eb91f15975fed7555a3aa52807ecd5698a1.tar.gz
rust-36195eb91f15975fed7555a3aa52807ecd5698a1.zip
libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.
Diffstat (limited to 'src/libstd/num/f32.rs')
-rw-r--r--src/libstd/num/f32.rs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/libstd/num/f32.rs b/src/libstd/num/f32.rs
index e9ea0df2a7b..66d93c230a5 100644
--- a/src/libstd/num/f32.rs
+++ b/src/libstd/num/f32.rs
@@ -20,6 +20,7 @@ use intrinsics;
 use libc::c_int;
 use num::strconv;
 use num;
+use strbuf::StrBuf;
 
 pub use core::f32::{RADIX, MANTISSA_DIGITS, DIGITS, EPSILON, MIN_VALUE};
 pub use core::f32::{MIN_POS_VALUE, MAX_VALUE, MIN_EXP, MAX_EXP, MIN_10_EXP};
@@ -242,7 +243,7 @@ impl FloatMath for f32 {
 ///
 /// * num - The float value
 #[inline]
-pub fn to_str(num: f32) -> ~str {
+pub fn to_str(num: f32) -> StrBuf {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
     r
@@ -254,7 +255,7 @@ pub fn to_str(num: f32) -> ~str {
 ///
 /// * num - The float value
 #[inline]
-pub fn to_str_hex(num: f32) -> ~str {
+pub fn to_str_hex(num: f32) -> StrBuf {
     let (r, _) = strconv::float_to_str_common(
         num, 16u, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
     r
@@ -268,7 +269,7 @@ pub fn to_str_hex(num: f32) -> ~str {
 /// * num - The float value
 /// * radix - The base to use
 #[inline]
-pub fn to_str_radix_special(num: f32, rdx: uint) -> (~str, bool) {
+pub fn to_str_radix_special(num: f32, rdx: uint) -> (StrBuf, bool) {
     strconv::float_to_str_common(num, rdx, true,
                            strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false)
 }
@@ -281,7 +282,7 @@ pub fn to_str_radix_special(num: f32, rdx: uint) -> (~str, bool) {
 /// * num - The float value
 /// * digits - The number of significant digits
 #[inline]
-pub fn to_str_exact(num: f32, dig: uint) -> ~str {
+pub fn to_str_exact(num: f32, dig: uint) -> StrBuf {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpNone, false);
     r
@@ -295,7 +296,7 @@ pub fn to_str_exact(num: f32, dig: uint) -> ~str {
 /// * num - The float value
 /// * digits - The number of significant digits
 #[inline]
-pub fn to_str_digits(num: f32, dig: uint) -> ~str {
+pub fn to_str_digits(num: f32, dig: uint) -> StrBuf {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpNone, false);
     r
@@ -310,7 +311,7 @@ pub fn to_str_digits(num: f32, dig: uint) -> ~str {
 /// * digits - The number of digits after the decimal point
 /// * upper - Use `E` instead of `e` for the exponent sign
 #[inline]
-pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> ~str {
+pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> StrBuf {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigExact(dig), strconv::ExpDec, upper);
     r
@@ -325,7 +326,7 @@ pub fn to_str_exp_exact(num: f32, dig: uint, upper: bool) -> ~str {
 /// * digits - The number of digits after the decimal point
 /// * upper - Use `E` instead of `e` for the exponent sign
 #[inline]
-pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> ~str {
+pub fn to_str_exp_digits(num: f32, dig: uint, upper: bool) -> StrBuf {
     let (r, _) = strconv::float_to_str_common(
         num, 10u, true, strconv::SignNeg, strconv::DigMax(dig), strconv::ExpDec, upper);
     r
@@ -345,7 +346,7 @@ impl num::ToStrRadix for f32 {
     /// possible misinterpretation of the result at higher bases. If those values
     /// are expected, use `to_str_radix_special()` instead.
     #[inline]
-    fn to_str_radix(&self, rdx: uint) -> ~str {
+    fn to_str_radix(&self, rdx: uint) -> StrBuf {
         let (r, special) = strconv::float_to_str_common(
             *self, rdx, true, strconv::SignNeg, strconv::DigAll, strconv::ExpNone, false);
         if special { fail!("number has a special value, \