I would like to manage user input for example by storing it in a string. I
found this solution:

use std::io::buffered::BufferedReader;
use std::io::stdin;

fn main()
{
    let mut stdin = BufferedReader::new(stdin());
    let mut s1 = stdin.read_line().unwrap_or(~"nothing");
    print(s1);
 }

It works but it seems (to me) a bit verbose, heavy... is there a cheaper
way to do this simple task?

Thx.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to