Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::fs::File;
- use std::io::{BufReader, BufRead};
- fn main() {
- let file = File::open("data.txt").unwrap();
- let reader = BufReader::new(file);
- let lines = reader.lines().map(|line| line.unwrap());
- let res = lines.flat_map(|line| line.split_whitespace());
- println!("{:?}", res);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement