1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/// Macro `input!`, similar to Python's `input()`. /// /// Usage: /// ```no_run /// use askit::input; /// /// fn sample() { /// let name = input!("Enter your name: "); /// println!("Hello, {name}"); /// } /// ``` #[macro_export] macro_rules! input { ($msg:expr) => {{ $crate::prompt($msg).get::<String>().unwrap() }}; }