Process stdin instead of opening a file path.
This commit is contained in:
parent
8df226190b
commit
f34a222c51
|
@ -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
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user