rust stdin code example
Example: how to read from stdin rust
use std::io;
let mut input = String::new();
match io::stdin().read_line(&mut input) {
Ok(n) => {
println!("{} bytes read", n);
println!("{}", input);
}
Err(error) => println!("error: {}", error),
}Run