Process stdin instead of opening a file path.
This commit is contained in:
parent
8df226190b
commit
f34a222c51
|
@ -1,5 +1,5 @@
|
||||||
use std::{
|
use std::{
|
||||||
fs::File,
|
// fs::File,
|
||||||
io::{Cursor, Read},
|
io::{Cursor, Read},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,10 +24,7 @@ fn main() {
|
||||||
|
|
||||||
let text = {
|
let text = {
|
||||||
let mut text = String::new();
|
let mut text = String::new();
|
||||||
File::open(std::env::args().nth(1).unwrap())
|
std::io::stdin().read_to_string(&mut text).unwrap();
|
||||||
.unwrap()
|
|
||||||
.read_to_string(&mut text)
|
|
||||||
.unwrap();
|
|
||||||
text
|
text
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user