You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: file4.rs
    path of file: ./repos/gentle-intro/code
    
    the code of the file until where you have to start completion: // file4.rs
use std::fs::File;
use std::io;
use std::io::prelude::*;

fn read_all_lines(filena
    
fn read_all_lines(filename: &str) -> io::Result<()> {
    let file = File::open(&filename)?;

    let mut reader = io::BufReader::new(file);
    let mut buf = String::new();
    let mut stdout = io::stdout();
    while reader.read_line(&mut buf)? > 0 {
        {
            let line = buf.trim_right();
            write!(stdout,"{}\n",line)?;
        }
        buf.clear();
    }

/*
    for line in reader.lines() {
        let line = line?;
        println!("{}",line);
    }
*/
    Ok(())
}