mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-20 00:00:08 +02:00
19 lines
428 B
Rust
19 lines
428 B
Rust
// A cat-like utility that can be used as a subprocess to test I/O
|
|
// stream communication.
|
|
use std::io;
|
|
use std::io::Write;
|
|
|
|
fn main() {
|
|
let stdin = io::stdin();
|
|
let mut stdout = io::stdout();
|
|
let mut line = String::new();
|
|
loop {
|
|
line.clear();
|
|
stdin.read_line(&mut line).unwrap();
|
|
if line.len() == 0 {
|
|
break;
|
|
}
|
|
stdout.write(line.as_bytes()).unwrap();
|
|
}
|
|
}
|