Skip to content

Commit 58e176e

Browse files
retragejosephlr
authored andcommitted
efi: fix const_item_mutation
CONST_ITEM_MUTATION list[1] warns mutable copy of STDIN and STDOUT when creating UEFI SystemTable. This commit fixes these warnings. [1] rust-lang/rust#75573 Signed-off-by: Akira Moroo <[email protected]> Signed-off-by: Joe Richey <[email protected]>
1 parent e9d1091 commit 58e176e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/efi/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,8 @@ pub fn efi_exec(
730730
}
731731
};
732732

733+
let mut stdin = console::STDIN;
734+
let mut stdout = console::STDOUT;
733735
let mut st = efi::SystemTable {
734736
hdr: efi::TableHeader {
735737
signature: efi::SYSTEM_TABLE_SIGNATURE,
@@ -741,11 +743,11 @@ pub fn efi_exec(
741743
firmware_vendor: core::ptr::null_mut(), // TODO,
742744
firmware_revision: 0,
743745
console_in_handle: console::STDIN_HANDLE,
744-
con_in: &mut console::STDIN,
746+
con_in: &mut stdin,
745747
console_out_handle: console::STDOUT_HANDLE,
746-
con_out: &mut console::STDOUT,
748+
con_out: &mut stdout,
747749
standard_error_handle: console::STDERR_HANDLE,
748-
std_err: &mut console::STDOUT,
750+
std_err: &mut stdout,
749751
runtime_services: &mut rs,
750752
boot_services: &mut bs,
751753
number_of_table_entries: 1,

0 commit comments

Comments
 (0)