3 ms·
The `bytes()` iterator is stable and provides a stream of u8 (well io::Result<u8>) which is sufficient for what you want. I don't think there's a good way to de
by masklinn 11y ago
The `bytes()` iterator is stable and provides a stream of u8 (well io::Result<u8>) which is sufficient for what you want. I don't think there's a good way to decode an iterator of bytes (which bytes isn't either way, but it could be adapted) to a chars iterator at the moment.
- rogual 11y agoThank you. Bytes will do just fine. I'm glad Rust is pedantic about bytes vs. chars.
- steveklabnik 11y agoTo elaborate slightly further, char in Rust is four bytes, as it represents a Unicode Scalar Value. So the chars iterator isn't yet stable because it's not clear what should be done in the case of a read of a partial char. This is, of course, fixable, there's just a lot to do, and that's the question for this specific API.