input_macro_fold_func 0.1.0

A small crate for handling user input more easilly
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#[macro_export]
macro_rules! input {
    ($prompt:expr) => {{
        use std::io::{self, Write};
        print!("{}", $prompt);
        io::stdout().flush().unwrap();

        let mut input = String::new();
        io::stdin()
            .read_line(&mut input)
            .expect("Error reading input");
        input.trim().to_string()
    }};
}