Skip to content

Commit 734b34d

Browse files
committed
Update documentation to parse_bytes
1 parent 796b9ce commit 734b34d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,16 @@ impl BigDecimal {
156156

157157
/// Creates and initializes a `BigDecimal`.
158158
///
159+
/// Decodes using `str::from_utf8` and forwards to `BigDecimal::from_str_radix`.
160+
/// Only base-10 is supported.
161+
///
159162
/// # Examples
160163
///
161164
/// ```
162165
/// use bigdecimal::{BigDecimal, Zero};
163166
///
164167
/// assert_eq!(BigDecimal::parse_bytes(b"0", 10).unwrap(), BigDecimal::zero());
165-
/// // assert_eq!(BigDecimal::parse_bytes(b"f", 16), BigDecimal::parse_bytes(b"16", 10));
168+
/// assert_eq!(BigDecimal::parse_bytes(b"13", 10).unwrap(), BigDecimal::from(13));
166169
/// ```
167170
#[inline]
168171
pub fn parse_bytes(buf: &[u8], radix: u32) -> Option<BigDecimal> {

0 commit comments

Comments
 (0)