Rollup merge of #60041 - jnferner:patch-1, r=shepmaster

Simplify the returning of a Result a bit
This commit is contained in:
Mazdak Farrokhzad 2019-04-19 06:03:14 +02:00 committed by GitHub
commit 2171250ca4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -901,8 +901,7 @@ impl OpenOptions {
}
fn _open(&self, path: &Path) -> io::Result<File> {
let inner = fs_imp::File::open(path, &self.0)?;
Ok(File { inner })
fs_imp::File::open(path, &self.0).map(|inner| File { inner })
}
}