Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/fde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::uefi::hii::{AnimationId, ImageId, StringId};
use std::uefi::text::TextInputKey;

use crate::display::{Display, Output};
use crate::key::{raw_key, Key};
use crate::key::{Key, raw_key};
use crate::ui::Ui;

// TODO: Move to uefi library {
Expand Down Expand Up @@ -44,7 +44,7 @@ impl HiiStringProtocol {
let mut len = data.len();
Result::from((self.GetString)(
self,
b"en-US\0".as_ptr(),
c"en-US".as_ptr() as *const u8,
PackageList,
StringId,
data.as_mut_ptr(),
Expand Down Expand Up @@ -511,9 +511,7 @@ fn form_display_inner(form: &Form, user_input: &mut UserInput) -> Result<()> {

if let Some(op) = statement.OpCode() {
macro_rules! cast {
($type:ty) => {{
op.cast::<$type>()
}};
($type:ty) => {{ op.cast::<$type>() }};
}
match op.OpCode {
IfrOpCode::Action => {
Expand Down Expand Up @@ -574,7 +572,7 @@ fn form_display_inner(form: &Form, user_input: &mut UserInput) -> Result<()> {
IfrTypeValueEnum::U32(value) => format!("{value}"),
IfrTypeValueEnum::U64(value) => format!("{value}"),
IfrTypeValueEnum::Bool(value) => {
return ui.draw_check_box(display, x, y, *value)
return ui.draw_check_box(display, x, y, *value);
}
other => format!("{other:?}"),
};
Expand Down
2 changes: 1 addition & 1 deletion src/image/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct ImageRoi<'a> {
image: &'a Image,
}

impl<'a> ImageRoi<'a> {
impl ImageRoi<'_> {
/// Draw the ROI on a window
pub fn draw<R: Renderer>(&self, renderer: &mut R, x: i32, mut y: i32) {
let stride = self.image.w;
Expand Down
8 changes: 2 additions & 6 deletions src/security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::proto::Protocol;
use std::uefi::{boot::InterfaceType, reset::ResetType};

use crate::display::{Display, Output};
use crate::key::{key, Key};
use crate::key::{Key, key};
use crate::rng::Rng;
use crate::ui::Ui;

Expand Down Expand Up @@ -63,11 +63,7 @@ fn confirm(display: &mut Display) -> Result<()> {
// } Style

let ui = Ui::new()?;

let rng = match Rng::one() {
Ok(ok) => ok,
Err(err) => return Err(err),
};
let rng = Rng::one()?;

// Clear any previous keys
let _ = key(false);
Expand Down