use std::fs::File; use std::io::Read; fn main() -> std::io::Result<()> { let mut file = File::open("example.txt")?; let mut contents = String::new(); file.read_to_string(&mut contents)?; println!("File contents: {}", contents); Ok(()) }