I'm trying to remove newline characters from a String (file content read from a file) and convert it to a Vec<u8>.
Example input string:
let ss = String::from("AAAAAAAA\nBBBBBBBBB\nCCCCCC\nDDDDD\n\n");
fn parse(s: String) -> Vec<u8> {
let s = s.chars().skip_while(|c| *c == '\n');
let sett = s.into_iter().map(|c| c as u8).collect();
sett
}
While I get no error, skip_while doesn't seem to remove the newline characters from the string. What am I doing wrong here?