pause_console 0.1.0

Pauses the console
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::io::{stdin, stdout, Read, Write};

pub fn pause_with_message(message: String) {
    let mut stdout = stdout();
    stdout.write(b"\n").unwrap();
    stdout.write(message.as_bytes()).unwrap();
    stdout.flush().unwrap();
    stdin().read(&mut [0]).unwrap();
}

pub fn pause() {
    pause_with_message(String::from("Press Enter to continue..."));
}