📜  在 rusr 中读取文件 - Rust 代码示例

📅  最后修改于: 2022-03-11 14:49:25.344000             🧑  作者: Mango

代码示例1
use std::fs;

fn main() {
    
    let contents = fs::read_to_string(filename)
        .expect("Something went wrong reading the file");

    println!("With text:\n{}", contents);
}