From 38ab2a9dbb273d3ddcca23299e2f109e51463d98 Mon Sep 17 00:00:00 2001 From: Akira Moroo Date: Sun, 28 May 2023 06:21:11 +0000 Subject: [PATCH] build: Remove unneeded mut as suggested by clippy Signed-off-by: Akira Moroo --- src/block.rs | 6 +++--- src/efi/alloc.rs | 2 +- src/efi/mod.rs | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/block.rs b/src/block.rs index 24917839..e6ed210c 100644 --- a/src/block.rs +++ b/src/block.rs @@ -262,14 +262,14 @@ impl<'a> VirtioBlockDevice<'a> { let mut state = self.state.borrow_mut(); let next_head = state.next_head; - let mut d = &mut state.descriptors[next_head]; + let d = &mut state.descriptors[next_head]; let next_desc = (next_head + 1) % QUEUE_SIZE; d.addr = (&header as *const _) as u64; d.length = core::mem::size_of::() as u32; d.flags = VIRTQ_DESC_F_NEXT; d.next = next_desc as u16; - let mut d = &mut state.descriptors[next_desc]; + let d = &mut state.descriptors[next_desc]; let next_desc = (next_desc + 1) % QUEUE_SIZE; if request != RequestType::Flush { match data { @@ -294,7 +294,7 @@ impl<'a> VirtioBlockDevice<'a> { }; d.next = next_desc as u16; - let mut d = &mut state.descriptors[next_desc]; + let d = &mut state.descriptors[next_desc]; d.addr = (&footer as *const _) as u64; d.length = core::mem::size_of::() as u32; d.flags = VIRTQ_DESC_F_WRITE; diff --git a/src/efi/alloc.rs b/src/efi/alloc.rs index c306af06..6d31a616 100644 --- a/src/efi/alloc.rs +++ b/src/efi/alloc.rs @@ -55,7 +55,7 @@ impl Allocator { self.key += 1; if self.first_allocation.is_none() { - let mut a = &mut self.allocations[0]; + let a = &mut self.allocations[0]; a.in_use = true; a.next_allocation = None; diff --git a/src/efi/mod.rs b/src/efi/mod.rs index eb245cfd..10df108d 100644 --- a/src/efi/mod.rs +++ b/src/efi/mod.rs @@ -212,8 +212,8 @@ fn convert_internal_pointer(descriptors: &[alloc::MemoryDescriptor], ptr: u64) - } unsafe fn fixup_at_virtual(descriptors: &[alloc::MemoryDescriptor]) { - let mut st = &mut ST; - let mut rs = &mut RS; + let st = &mut ST; + let rs = &mut RS; let ptr = convert_internal_pointer(descriptors, (not_available as *const ()) as u64).unwrap(); rs.get_time = transmute(ptr); @@ -1174,7 +1174,7 @@ pub fn efi_exec( let mut stdin = console::STDIN; let mut stdout = console::STDOUT; - let mut st = unsafe { &mut ST }; + let st = unsafe { &mut ST }; st.con_in = &mut stdin; st.con_out = &mut stdout; st.std_err = &mut stdout;