pipedconsole 0.1.4

Piped console is a (currently windows-only) rust crate wich allows you to easily manage two or more different consoles from within one process.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

pub(crate) fn error<T: ToString>(message: &str, info: T) -> ! {

    eprintln!("\nA fatal error occured in the process: {}\n\nPress <enter> to exit.", message.replace("{}", &info.to_string()));
    std::io::stdin().read_line(&mut String::new()).unwrap_or_default();
    std::process::exit(2);

}

#[allow(dead_code)]
pub(crate) fn warning<T: ToString>(message: &str, info: T) {

    println!("\nSomething went wrong: {}", message.replace("{}", &info.to_string()));

}