Skip to content

Commit 3cb6e6f

Browse files
Use Result::ok (#496)
* Use `Result::ok` * Update uefi/src/main.rs --------- Co-authored-by: Tom Dohrmann <[email protected]>
1 parent 55918ea commit 3cb6e6f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

uefi/src/main.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,7 @@ fn load_file_from_disk(
313313

314314
let file_handle_result = root.open(filename, FileMode::Read, FileAttribute::empty());
315315

316-
let file_handle = match file_handle_result {
317-
Err(_) => return None,
318-
Ok(handle) => handle,
319-
};
316+
let file_handle = file_handle_result.ok()?;
320317

321318
let mut file = match file_handle.into_type().unwrap() {
322319
uefi::proto::media::file::FileType::Regular(f) => f,

0 commit comments

Comments
 (0)