summary refs log tree commit diff
path: root/src/libstd/num/strconv.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-05-10 14:19:26 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-05-15 23:22:06 -0700
commitc36525200240b1fae7e6871790b60aec856c2147 (patch)
tree6d96d91abda197a879a023b6b8409d80d9a47879 /src/libstd/num/strconv.rs
parentbcab97a32eca0bec431ff3d1065f07e10c600d80 (diff)
downloadrust-c36525200240b1fae7e6871790b60aec856c2147.tar.gz
rust-c36525200240b1fae7e6871790b60aec856c2147.zip
std: Delegate some integer formatting to core::fmt
In an attempt to phase out the std::num::strconv module's string formatting
functionality, this commit reimplements some provided methods for formatting
integers on top of format!() instead of the custom (and slower) implementation
inside of num::strconv.

Primarily, this deprecates int_to_str_bytes_common
Diffstat (limited to 'src/libstd/num/strconv.rs')
-rw-r--r--src/libstd/num/strconv.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs
index c2ec5c75fc1..c6cb57665a3 100644
--- a/src/libstd/num/strconv.rs
+++ b/src/libstd/num/strconv.rs
@@ -170,6 +170,7 @@ static NAN_BUF:          [u8, ..3] = ['N' as u8, 'a' as u8, 'N' as u8];
  * # Failure
  * - Fails if `radix` < 2 or `radix` > 36.
  */
+#[deprecated = "format!() and friends should be favored instead"]
 pub fn int_to_str_bytes_common<T: Int>(num: T, radix: uint, sign: SignFormat, f: |u8|) {
     assert!(2 <= radix && radix <= 36);
 
@@ -258,6 +259,7 @@ pub fn int_to_str_bytes_common<T: Int>(num: T, radix: uint, sign: SignFormat, f:
  * - Fails if `radix` > 25 and `exp_format` is `ExpBin` due to conflict
  *   between digit and exponent sign `'p'`.
  */
+#[allow(deprecated)]
 pub fn float_to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Float+
                                   Div<T,T>+Neg<T>+Rem<T,T>+Mul<T,T>>(
         num: T, radix: uint, negative_zero: bool,