Files
tokio/tests-integration/src/bin/test-cat.rs
T

15 lines
368 B
Rust
Raw Normal View History

//! A cat-like utility that can be used as a subprocess to test I/O
//! stream communication.
use tokio::io::AsyncWriteExt;
2016-11-18 20:57:31 +01:00
#[tokio::main(flavor = "current_thread")]
async fn main() {
let mut stdin = tokio::io::stdin();
let mut stdout = tokio::io::stdout();
tokio::io::copy(&mut stdin, &mut stdout).await.unwrap();
stdout.flush().await.unwrap();
2016-11-18 20:57:31 +01:00
}