Function core::num::dec2flt::num::from_str_unchecked
[−]
[src]
pub fn from_str_unchecked<'a, T>(bytes: T) -> u64 where T: IntoIterator<Item=&'a u8>
Unstable (
dec2flt
): internal routines only exposed for testing
Convert an ASCII string containing only decimal digits to a u64
.
Does not perform checks for overflow or invalid characters, so if the caller is not careful,
the result is bogus and can panic (though it won't be unsafe
). Additionally, empty strings
are treated as zero. This function exists because
- using
FromStr
on&[u8]
requiresfrom_utf8_unchecked
, which is bad, and - piecing together the results of
integral.parse()
andfractional.parse()
is more complicated than this entire function.