Skip to content

Commit 4b77de3

Browse files
authored
Rollup merge of rust-lang#60041 - jnferner:patch-1, r=shepmaster
Simplify the returning of a Result a bit
2 parents 9047e9c + 379c541 commit 4b77de3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libstd/fs.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,7 @@ impl OpenOptions {
901901
}
902902

903903
fn _open(&self, path: &Path) -> io::Result<File> {
904-
let inner = fs_imp::File::open(path, &self.0)?;
905-
Ok(File { inner })
904+
fs_imp::File::open(path, &self.0).map(|inner| File { inner })
906905
}
907906
}
908907

0 commit comments

Comments
 (0)