diff --git a/src/fde.rs b/src/fde.rs index 72f691d..ca41368 100644 --- a/src/fde.rs +++ b/src/fde.rs @@ -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 { @@ -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(), @@ -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 => { @@ -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:?}"), }; diff --git a/src/image/mod.rs b/src/image/mod.rs index b9b8ac6..539d0c1 100644 --- a/src/image/mod.rs +++ b/src/image/mod.rs @@ -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(&self, renderer: &mut R, x: i32, mut y: i32) { let stride = self.image.w; diff --git a/src/security.rs b/src/security.rs index 013e727..90622e6 100644 --- a/src/security.rs +++ b/src/security.rs @@ -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; @@ -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);