no method named flush found for type std::io::Stdout in the current scope

You need to import the trait that implements the flush method for Stdout.

According to the documentation:

io::Write

Therefore:

use std::io::Write; // <--- bring the trait into scope

fn main() {
    std::io::stdout().flush().expect("some error message");
}

Playground example

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)