Process stdin instead of opening a file path.

This commit is contained in:
Nathan Vegdahl 2024-09-01 09:27:15 +02:00
parent 8df226190b
commit f34a222c51

View File

@ -1,5 +1,5 @@
use std::{
fs::File,
// fs::File,
io::{Cursor, Read},
};
@ -24,10 +24,7 @@ fn main() {
let text = {
let mut text = String::new();
File::open(std::env::args().nth(1).unwrap())
.unwrap()
.read_to_string(&mut text)
.unwrap();
std::io::stdin().read_to_string(&mut text).unwrap();
text
};