Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let tmpfile = BufReader::new(manifest.get_ref().clone());
- let lines: Vec<Result<String, std::io::Error>> = tmpfile.lines().collect();
- let mut count = 0;
- for line in lines {
- match line {
- Ok(ref s) => {
- println!("line: {}", s);
- if !s.is_empty() {
- println!("This line is not empty");
- count += 1;
- }
- },
- _ => println!("line: (null)")
- };
- }
- println!("Number of non-blank lines: {}", count);
Advertisement
Add Comment
Please, Sign In to add comment