Skip to content

Commit

Permalink
Use Result::ok (#496)
Browse files Browse the repository at this point in the history
* Use `Result::ok`

* Update uefi/src/main.rs

---------

Co-authored-by: Tom Dohrmann <Erbse.13@gmx.de>
  • Loading branch information
ChocolateLoverRaj and Freax13 authored Feb 25, 2025
1 parent 55918ea commit 3cb6e6f
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions uefi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,7 @@ fn load_file_from_disk(

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

let file_handle = match file_handle_result {
Err(_) => return None,
Ok(handle) => handle,
};
let file_handle = file_handle_result.ok()?;

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

0 comments on commit 3cb6e6f

Please sign in to comment.