From 2c0d4af9452019154c8352e90d4d0cfe519580e7 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Wed, 13 Nov 2024 07:25:31 -0700 Subject: [PATCH] Update toolchain to 2024-05-11 Fix `unused_mut` and allow `dead_code` to silence warnings. Signed-off-by: Tim Crawford --- rust-toolchain.toml | 2 +- src/fde.rs | 9 +++++---- src/hii.rs | 1 + src/key.rs | 1 + src/security.rs | 1 + 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 4660956..289d2e1 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "nightly-2023-01-21" +channel = "nightly-2024-05-11" targets = ["x86_64-unknown-uefi"] profile = "minimal" diff --git a/src/fde.rs b/src/fde.rs index 2483b77..b9c5c9b 100644 --- a/src/fde.rs +++ b/src/fde.rs @@ -133,6 +133,7 @@ impl ListEntry { pub trait ListEntryObject { unsafe fn object(&self) -> &T; + #[allow(dead_code)] unsafe fn object_mut(&mut self) -> &mut T; } @@ -863,7 +864,7 @@ fn form_display_inner(form: &Form, user_input: &mut UserInput) -> Result<()> { }, Key::Down => { if editing { - if let Some(mut element) = elements.get_mut(selected) { + if let Some(element) = elements.get_mut(selected) { if element.list { if element.list_i + 1 < element.options.len() { element.list_i += 1; @@ -909,7 +910,7 @@ fn form_display_inner(form: &Form, user_input: &mut UserInput) -> Result<()> { }, Key::Up => { if editing { - if let Some(mut element) = elements.get_mut(selected) { + if let Some(element) = elements.get_mut(selected) { if element.list { if element.list_i > 0 { element.list_i -= 1; @@ -959,7 +960,7 @@ fn form_display_inner(form: &Form, user_input: &mut UserInput) -> Result<()> { }, Key::PageDown => { if editing { - if let Some(mut element) = elements.get_mut(selected) { + if let Some(element) = elements.get_mut(selected) { if element.list && element.list_i + 1 < element.options.len() { element.options.swap(element.list_i, element.list_i + 1); element.list_i += 1; @@ -969,7 +970,7 @@ fn form_display_inner(form: &Form, user_input: &mut UserInput) -> Result<()> { }, Key::PageUp => { if editing { - if let Some(mut element) = elements.get_mut(selected) { + if let Some(element) = elements.get_mut(selected) { if element.list && element.list_i > 0 { element.list_i -= 1; element.options.swap(element.list_i, element.list_i + 1); diff --git a/src/hii.rs b/src/hii.rs index bc4ef9e..0848622 100644 --- a/src/hii.rs +++ b/src/hii.rs @@ -5,6 +5,7 @@ use std::prelude::*; use std::uefi::hii::database::HiiDatabase; use std::uefi::guid::HII_DATABASE_GUID; +#[allow(dead_code)] pub struct Database(pub &'static mut HiiDatabase); impl Protocol for Database { diff --git a/src/key.rs b/src/key.rs index 75be2d9..4f281cd 100644 --- a/src/key.rs +++ b/src/key.rs @@ -4,6 +4,7 @@ use core::char; use std::prelude::*; use std::uefi::text::TextInputKey; +#[allow(dead_code)] #[derive(Debug)] pub enum Key { Backspace, diff --git a/src/security.rs b/src/security.rs index be55baa..272c1db 100644 --- a/src/security.rs +++ b/src/security.rs @@ -303,6 +303,7 @@ extern "efiapi" fn run() -> bool { pub const SYSTEM76_SECURITY_PROTOCOL_GUID: Guid = Guid(0x764247c4, 0xa859, 0x4a6b, [0xb5, 0x00, 0xed, 0x5d, 0x7a, 0x70, 0x7d, 0xd4]); pub struct System76SecurityProtocol { + #[allow(dead_code)] pub Run: extern "efiapi" fn() -> bool, }