You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now it is impossible to parse strings of the form [0-9]+.+ without practically rewriting the parser or using the correct libc function (strtol).
Most of the time the UTF-8 property is irrelevant. Most things parse bytes.
traitFromBytes<T>{/// Tries to convert the initial portion of `b` to `T` and returns the number of bytes/// consumed.fnfrom_bytes_initial(b:&[u8]) -> Option<(T,uint)>;/// Tries to convert `b` to `T`.fnfrom_bytes(b:&[u8]) -> Option<T>{matchFromBytes::from_bytes_initial(b){Some((t, n))if n == b.len() => Some(t),
_ => None,}}/// Tries to convert the initial portion of `s` to `T` and returns the number of bytes/// consumed.fnfrom_str_initial(s:&str) -> Option<(T,uint)>{FromBytes::from_bytes_initial(s.as_bytes())}/// Tries to convert `s` to `T`.fnfrom_str(s:&str) -> Option<T>{FromBytes::from_bytes(s.as_bytes())}}
The text was updated successfully, but these errors were encountered:
cc #6220 (at least, this sort of API is mentioned there and would be useful for it).
I don't know if want from_bytes to be the default so deeply, since things that do want to parse unicode are then required to remember to override everything, at the expense of a pile of from_utf8 calls (especially bad for something recursive). Maybe this doesn't matter much in practice.
huonw
added
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
A-libs
and removed
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
labels
Sep 20, 2014
The text was updated successfully, but these errors were encountered: