Skip to content

rustfmt not remove extra blank lines on top of the file and on the middle of the functions #2025

Closed
@dumindu

Description

@dumindu

Current




use std::fs::File;
use std::io::Read;

fn main() {
    let mut file = File::open("src/hello.txt").expect("file not found");
    let mut content = String::new();
    file.read_to_string(&mut content)
        .expect("can't read the file");



    println!("{}", content);
}

Expected

use std::fs::File;
use std::io::Read;

fn main() {
    let mut file = File::open("src/hello.txt").expect("file not found");
    let mut content = String::new();
    file.read_to_string(&mut content)
        .expect("can't read the file");
    
    println!("{}", content);
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions