use std::fs::File; use std::io::{BufRead, BufReader}; fn main() { let file = File::open("f.txt").expect("File not found"); let reader = BufReader::new(file); for line in reader.lines() { println!("{}", line.unwrap()); } }
标签:use,BufReader,file,File,reader,txt,rust,读取 From: https://www.cnblogs.com/pythonClub/p/17332971.html