Skip to content

Commit

Permalink
Update toolchain to 2024-05-11
Browse files Browse the repository at this point in the history
Fix `unused_mut` and allow `dead_code` to silence warnings.

Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd authored and jackpot51 committed Nov 20, 2024
1 parent ef237e7 commit 2c0d4af
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-01-21"
channel = "nightly-2024-05-11"
targets = ["x86_64-unknown-uefi"]
profile = "minimal"
9 changes: 5 additions & 4 deletions src/fde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ impl<T> ListEntry<T> {
pub trait ListEntryObject<T> {
unsafe fn object(&self) -> &T;

#[allow(dead_code)]
unsafe fn object_mut(&mut self) -> &mut T;
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/hii.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<HiiDatabase> for Database {
Expand Down
1 change: 1 addition & 0 deletions src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use core::char;
use std::prelude::*;
use std::uefi::text::TextInputKey;

#[allow(dead_code)]
#[derive(Debug)]
pub enum Key {
Backspace,
Expand Down
1 change: 1 addition & 0 deletions src/security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}

Expand Down

0 comments on commit 2c0d4af

Please sign in to comment.