diff --git a/src/libstd/fs.rs b/src/libstd/fs.rs index dea198d8c9178..1772879d01362 100644 --- a/src/libstd/fs.rs +++ b/src/libstd/fs.rs @@ -901,8 +901,7 @@ impl OpenOptions { } fn _open(&self, path: &Path) -> io::Result { - let inner = fs_imp::File::open(path, &self.0)?; - Ok(File { inner }) + fs_imp::File::open(path, &self.0).map(|inner| File { inner }) } }