10 lines
300 B
Rust
10 lines
300 B
Rust
|
use std::fs::File;
|
||
|
use std::io::{prelude::*, BufReader};
|
||
|
|
||
|
pub fn read_file(path: &'static str) -> impl Iterator<Item = String> {
|
||
|
let reader = BufReader::new(File::open(path).expect("File not found"));
|
||
|
reader
|
||
|
.lines()
|
||
|
.map(|l| l.expect(&format!("Could not read from file")))
|
||
|
}
|