about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2017-11-24 18:52:42 +0100
committerSimon Sapin <simon.sapin@exyr.org>2017-11-24 19:16:32 +0100
commit5962d7e0079c4c2156a783e156a76c5d0824df22 (patch)
tree012018a5418a2df473b16b73d0fe6532ebc61c90 /src/libcore
parent71da1c21ebc79f19e749344c8b4e2c13f533872e (diff)
Expand docs of <$Int>::from_str_radix, based on that of char::to_digit
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/num/mod.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index 1230066e2b3..19e91a65964 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -132,7 +132,14 @@ macro_rules! int_impl {
 
         /// Converts a string slice in a given base to an integer.
         ///
+        /// The string is expected to be an optional `+` or `-` sign
+        /// followed by digits.
         /// Leading and trailing whitespace represent an error.
+        /// Digits are a subset of these characters, depending on `radix`:
+        ///
+        /// * `0-9`
+        /// * `a-z`
+        /// * `A-Z`
         ///
         /// # Panics
         ///
@@ -1301,7 +1308,18 @@ macro_rules! uint_impl {
 
         /// Converts a string slice in a given base to an integer.
         ///
+        /// The string is expected to be an optional `+` sign
+        /// followed by digits.
         /// Leading and trailing whitespace represent an error.
+        /// Digits are a subset of these characters, depending on `radix`:
+        ///
+        /// * `0-9`
+        /// * `a-z`
+        /// * `A-Z`
+        ///
+        /// # Panics
+        ///
+        /// This function panics if `radix` is not in the range from 2 to 36.
         ///
         /// # Examples
         ///