|
|
@ -19,7 +19,7 @@ use std::fs;
|
|
|
|
// These must live longer than `readable`, and thus are declared first:
|
|
|
|
// These must live longer than `readable`, and thus are declared first:
|
|
|
|
let (mut stdin_read, mut file_read);
|
|
|
|
let (mut stdin_read, mut file_read);
|
|
|
|
|
|
|
|
|
|
|
|
// We need to ascribe the type to get dynamic dispatch.
|
|
|
|
// We need to describe the type to get dynamic dispatch.
|
|
|
|
let readable: &mut dyn io::Read = if arg == "-" {
|
|
|
|
let readable: &mut dyn io::Read = if arg == "-" {
|
|
|
|
stdin_read = io::stdin();
|
|
|
|
stdin_read = io::stdin();
|
|
|
|
&mut stdin_read
|
|
|
|
&mut stdin_read
|
|
|
|