diff --git a/src/main.rs b/src/main.rs index a5d16f5..23e70c6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,12 +1,8 @@ -use std::{fs::File, io::{BufRead, BufReader}}; -use std::io::Write; +use std::io; fn main() { - let pts_read = File::open("/dev/pts0").unwrap(); - let mut pts_write = File::open("/dev/pts0").unwrap(); - - for line in BufReader::new(pts_read).lines() { + for line in io::stdin().lines() { let line = line.unwrap(); - writeln!(pts_write, "Got line on PTS: {:?}", line).unwrap(); + println!("Got line on PTS: {:?}", line); } }