12 lines
345 B
Rust
12 lines
345 B
Rust
use std::io::BufRead;
|
|
|
|
/// Wait for stdin terminal input and send it to the node if any arrives
|
|
pub(crate) fn input(stdin_sender: std::sync::mpsc::Sender<String>) {
|
|
let stdin = std::io::stdin();
|
|
let lines = stdin.lock().lines();
|
|
for line in lines {
|
|
let line = line.unwrap();
|
|
stdin_sender.send(line).unwrap();
|
|
}
|
|
}
|