Skip to content

Commit

Permalink
Fix some clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
YtvwlD committed Jul 20, 2023
1 parent 3e01a45 commit a59161e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/boot/elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ impl From<OurElfLoader> for Vec<Allocation> {
// Gets the allocated memory.
fn from(loader: OurElfLoader) -> Vec<Allocation> {
// using .values() would just borrow the values from the hash map
loader.allocations.into_iter().map(|(_k, v)| v).collect()
loader.allocations.into_values().collect()
}
}

Expand All @@ -133,7 +133,7 @@ pub(super) fn symbols(

// copy the symbols
// only copy sections that are not already loaded
for mut section in binary.section_headers.iter_mut().filter(
for section in binary.section_headers.iter_mut().filter(
|s| s.sh_addr == 0 && s.file_range().is_some()
) {
let index = memory.len();
Expand Down
8 changes: 4 additions & 4 deletions src/boot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use uefi::table::cfg::ConfigTableEntry;

use log::{debug, info, error, warn};

use multiboot12::header::{Header, Addresses as MultibootAddresses};
use multiboot12::header::Header;
use multiboot12::information::{
Module, InfoBuilder, Symbols
};
Expand Down Expand Up @@ -93,7 +93,7 @@ impl LoadedKernel {
// drop the old vector
core::mem::drop(kernel_vec);

let entry_point = get_kernel_uefi_entry(header, &quirks)
let entry_point = get_kernel_uefi_entry(header, quirks)
.or(header.get_entry_address().map(
|e| EntryPoint::Multiboot(e as usize)
))
Expand Down Expand Up @@ -123,7 +123,7 @@ impl LoadedKernel {
Status::LOAD_ERROR
})?;
let symbols = Some(elf::symbols(header, &mut binary, kernel_vec.as_slice()));
let entry_point = get_kernel_uefi_entry(header, &quirks)
let entry_point = get_kernel_uefi_entry(header, quirks)
.or(header.get_entry_address().map(
|e| EntryPoint::Multiboot(e as usize)
))
Expand Down Expand Up @@ -355,7 +355,7 @@ impl<'a> PreparedEntry<'a> {
// the returned memory map (including the version!),
// we might want to pass that instead.
let mut mb_efi_mmap_vec = self.multiboot_information
.allocate_efi_memory_map_vec(estimated_count.try_into().unwrap());
.allocate_efi_memory_map_vec(estimated_count);
let mut mb_mmap_vec = self.multiboot_information
.allocate_memory_map_vec(estimated_count);
self.multiboot_information.set_memory_bounds(Some((0, 0)));
Expand Down
2 changes: 1 addition & 1 deletion src/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ fn dump_memory_map() {
///
/// This needs to have a buffer to write to because we can't allocate memory anymore.
/// (The buffer may be too large.)
pub(super) fn prepare_information<'a>(
pub(super) fn prepare_information(
info_bytes: &mut [u8],
mut update_memory_info: Box<dyn FnMut(
&mut [u8], u32, u32, &[multiboot12::information::MemoryEntry],
Expand Down

0 comments on commit a59161e

Please sign in to comment.