Skip to content

Instantly share code, notes, and snippets.

@nebuta
Created April 4, 2014 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nebuta/9980142 to your computer and use it in GitHub Desktop.
Save nebuta/9980142 to your computer and use it in GitHub Desktop.
Rust echo example
// Compiles on rustc 0.11-pre-nightly (540c2a2 2014-04-04 01:01:51 -0700)
use std::io::BufferedReader;
use std::io::stdin;
fn main(){
let mut stdin = BufferedReader::new(stdin());
for line in stdin.lines() {
match line {
Ok(l) => print!("{}",l),
Err(_) => break
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment