Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn main() {
- let mut bytes = Vec::new();
- for i in u8::min_value()..u8::max_value() {
- bytes.push(i);
- }
- while let Err(error) = std::str::from_utf8(&bytes) {
- bytes.remove(error.valid_up_to());
- }
- println!("Result: \"{}\"", std::str::from_utf8(&bytes).unwrap());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement