about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-11-28 00:01:23 +0000
committerbors <bors@rust-lang.org>2014-11-28 00:01:23 +0000
commiteb4e0f77043090aa404d1d935274e9cf289d33ba (patch)
treeecd6662a31c93faab23c8000cd1a304dbc0b8b67 /src/libstd
parent3dd5443ebd2e34baf51010245a6bce6f12552a22 (diff)
parentc67dbed11cce16fdd6999c10960bfd3ad5911945 (diff)
downloadrust-eb4e0f77043090aa404d1d935274e9cf289d33ba.tar.gz
rust-eb4e0f77043090aa404d1d935274e9cf289d33ba.zip
auto merge of #19354 : barosl/rust/strconv-doc-fix, r=steveklabnik
- `int_to_str_bytes_common()` doesn't have a return value.
- `float_to_str_bytes_common()` has an old-style doc comment.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/num/strconv.rs76
1 files changed, 35 insertions, 41 deletions
diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs
index be6e387ad83..b42286c0308 100644
--- a/src/libstd/num/strconv.rs
+++ b/src/libstd/num/strconv.rs
@@ -83,13 +83,6 @@ pub enum SignFormat {
 /// - `f`             - a callback which will be invoked for each ascii character
 ///                     which composes the string representation of this integer
 ///
-/// # Return value
-///
-/// A tuple containing the byte vector, and a boolean flag indicating
-/// whether it represents a special value like `inf`, `-inf`, `NaN` or not.
-/// It returns a tuple because there can be ambiguity between a special value
-/// and a number representation at higher bases.
-///
 /// # Panics
 ///
 /// - Panics if `radix` < 2 or `radix` > 36.
@@ -147,40 +140,41 @@ fn int_to_str_bytes_common<T: Int>(num: T, radix: uint, sign: SignFormat, f: |u8
     }
 }
 
-/**
- * Converts a number to its string representation as a byte vector.
- * This is meant to be a common base implementation for all numeric string
- * conversion functions like `to_string()` or `to_str_radix()`.
- *
- * # Arguments
- * - `num`           - The number to convert. Accepts any number that
- *                     implements the numeric traits.
- * - `radix`         - Base to use. Accepts only the values 2-36. If the exponential notation
- *                     is used, then this base is only used for the significand. The exponent
- *                     itself always printed using a base of 10.
- * - `negative_zero` - Whether to treat the special value `-0` as
- *                     `-0` or as `+0`.
- * - `sign`          - How to emit the sign. See `SignFormat`.
- * - `digits`        - The amount of digits to use for emitting the fractional
- *                     part, if any. See `SignificantDigits`.
- * - `exp_format`   - Whether or not to use the exponential (scientific) notation.
- *                    See `ExponentFormat`.
- * - `exp_capital`   - Whether or not to use a capital letter for the exponent sign, if
- *                     exponential notation is desired.
- *
- * # Return value
- * A tuple containing the byte vector, and a boolean flag indicating
- * whether it represents a special value like `inf`, `-inf`, `NaN` or not.
- * It returns a tuple because there can be ambiguity between a special value
- * and a number representation at higher bases.
- *
- * # Panics
- * - Panics if `radix` < 2 or `radix` > 36.
- * - Panics if `radix` > 14 and `exp_format` is `ExpDec` due to conflict
- *   between digit and exponent sign `'e'`.
- * - Panics if `radix` > 25 and `exp_format` is `ExpBin` due to conflict
- *   between digit and exponent sign `'p'`.
- */
+/// Converts a number to its string representation as a byte vector.
+/// This is meant to be a common base implementation for all numeric string
+/// conversion functions like `to_string()` or `to_str_radix()`.
+///
+/// # Arguments
+///
+/// - `num`           - The number to convert. Accepts any number that
+///                     implements the numeric traits.
+/// - `radix`         - Base to use. Accepts only the values 2-36. If the exponential notation
+///                     is used, then this base is only used for the significand. The exponent
+///                     itself always printed using a base of 10.
+/// - `negative_zero` - Whether to treat the special value `-0` as
+///                     `-0` or as `+0`.
+/// - `sign`          - How to emit the sign. See `SignFormat`.
+/// - `digits`        - The amount of digits to use for emitting the fractional
+///                     part, if any. See `SignificantDigits`.
+/// - `exp_format`   - Whether or not to use the exponential (scientific) notation.
+///                    See `ExponentFormat`.
+/// - `exp_capital`   - Whether or not to use a capital letter for the exponent sign, if
+///                     exponential notation is desired.
+///
+/// # Return value
+///
+/// A tuple containing the byte vector, and a boolean flag indicating
+/// whether it represents a special value like `inf`, `-inf`, `NaN` or not.
+/// It returns a tuple because there can be ambiguity between a special value
+/// and a number representation at higher bases.
+///
+/// # Panics
+///
+/// - Panics if `radix` < 2 or `radix` > 36.
+/// - Panics if `radix` > 14 and `exp_format` is `ExpDec` due to conflict
+///   between digit and exponent sign `'e'`.
+/// - Panics if `radix` > 25 and `exp_format` is `ExpBin` due to conflict
+///   between digit and exponent sign `'p'`.
 pub fn float_to_str_bytes_common<T: Float>(
         num: T, radix: uint, negative_zero: bool,
         sign: SignFormat, digits: SignificantDigits, exp_format: ExponentFormat, exp_upper: bool