catch-input 1.1.1

Library implementing a macro for retrieving user input from the console.
Documentation

catch-input

Crates.io Version Crates.io License Lines of Code

Rust library implementing a macro for retrieving user input from the console.

Example

use catch_input::input;

fn main() {
    let a = input!("PromptA => ");
    let b = input!(|| { print!("PromptB => ") });
    let c = input!((String::from("PromptC => ")));

    assert!(a, String::from("Catch"));
    assert!(b, String::from("Input"));
    assert!(c, String::from("Crate"));

    println!(">> {} : {} : {}", a, b, c);
}
$ cargo run
...

PromptA => Catch
PromptB => Input
PromptC => Crate
>> Catch : Input : Crate