pub fn get_input_with<F: FnOnce()>(func: F) -> String
Expand description

Returns a trimmed String containing the user input from standard input. You may pass a function that is meant to work as the input prompt.

Example

let inp = get_input_with(|| { print!("Input => "); });
assert!(inp, String::from("Hello, World!"));

The application input would like this…

Input => Hello, World!