Add explicit dyn before Traits

This commit is contained in:
Ryan Geary 2019-09-06 13:27:38 -04:00
parent b7c14b9c2d
commit 46d79d7250

View file

@ -40,8 +40,8 @@ fn main() {
let opt = Opt::from_args();
let read = match &opt.input {
Some(f) => Box::new(File::open(f).expect("Could not open file")) as Box<Read>,
None => Box::new(io::stdin()) as Box<Read>,
Some(f) => Box::new(File::open(f).expect("Could not open file")) as Box<dyn Read>,
None => Box::new(io::stdin()) as Box<dyn Read>,
};
let buf = BufReader::new(read);