You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let a:i32 = stdin.lock().lines().next().unwrap().unwrap().trim().parse().unwrap();
As i think, Rust needs easier way to do this. E. g. like:
let a = stdin.read::<i32>().ok().expect("Write a number!");let(b, c, d) = stdin.read::<(i32,f64,bool)>.ok().expect("Please, write integer, float and boolean!");
Activity
[-]New API for easiest value reading from stdin[/-][+]New API for easier value reading from stdin[/+]steveklabnik commentedon Jun 1, 2015
https://crates.io/crates/text_io exists already, you may want to check it out.
dFionov commentedon Jun 1, 2015
Not bad :) Thank you!