Skip to content

Commit

Permalink
build: Remove unneeded mut as suggested by clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Akira Moroo <[email protected]>
  • Loading branch information
retrage authored and rbradford committed May 30, 2023
1 parent 11181ba commit 38ab2a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<BlockRequestHeader>() 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 {
Expand All @@ -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::<BlockRequestFooter>() as u32;
d.flags = VIRTQ_DESC_F_WRITE;
Expand Down
2 changes: 1 addition & 1 deletion src/efi/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions src/efi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 38ab2a9

Please sign in to comment.