Pass stdin as a generic BufRead, fix stdin tests

This commit is contained in:
sharkdp
2020-04-18 11:37:12 +02:00
committed by David Peter
parent d5a31dc2ec
commit 1b8ce60054
3 changed files with 17 additions and 8 deletions

View File

@ -56,10 +56,8 @@ impl<'b> Controller<'b> {
let writer = output_type.handle()?;
let mut no_errors: bool = true;
let stdin = io::stdin();
for input_file in self.config.files.iter() {
match input_file.get_reader(&stdin) {
match input_file.get_reader(io::stdin().lock()) {
Err(error) => {
handle_error(&error);
no_errors = false;