diff --git a/pbs-tools/src/cli.rs b/pbs-tools/src/cli.rs index 069b23e2..62f17ac5 100644 --- a/pbs-tools/src/cli.rs +++ b/pbs-tools/src/cli.rs @@ -1,13 +1,16 @@ use std::fs::File; use std::io::{self, stdout, Write}; use std::path::Path; +use std::panic::{RefUnwindSafe, UnwindSafe}; /// Returns either a new file, if a path is given, or stdout, if no path is given. -pub fn outfile_or_stdout>(path: Option

) -> io::Result> { +pub fn outfile_or_stdout>( + path: Option

, +) -> io::Result> { if let Some(path) = path { let f = File::create(path)?; - Ok(Box::new(f) as Box) + Ok(Box::new(f) as Box<_>) } else { - Ok(Box::new(stdout()) as Box) + Ok(Box::new(stdout()) as Box<_>) } }