Remove use of Err()?
Clippy recommends that instead of 'Err(...)?' an explicit
return statement of the form 'return Err(...);' is used
since the '?' is meant for use inline in expressions.
@@ -601,10 +601,13 @@ impl<'a> FileReaderWithProgress<'a> {
pub fn new_file(path: &Path, notify_handler: &'a dyn Fn(Notification<'_>)) -> Result<Self> {
let fh = match std::fs::File::open(path) {
Ok(fh) => fh,
- Err(_) => Err(ErrorKind::ReadingFile {
+ Err(_) => {
+ return Err(ErrorKind::ReadingFile {
name: "downloaded",
path: path.to_path_buf(),
- })?,
+ }
+ .into())
+ }
};
// Inform the tracker of the file size
