pub fn read_string_stdin() -> Result<String, Error>
Expand description

Reads a line from std::io::stdin().lock() and trims it. Returns an error if the line is empty or if an error is returned from read_line().

Examples

let e = read_string_stdin().err().unwrap();
assert!(e.kind() == std::io::ErrorKind::InvalidInput);