Skip to content

Commit 7d93994

Browse files
committed
Run cargo fmt
1 parent aac1825 commit 7d93994

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

src/binary/mod.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ pub mod legacy_memory_region;
3030
pub mod level_4_entries;
3131
/// Implements a loader for the kernel ELF binary.
3232
pub mod load_kernel;
33-
/// Provides a logger type that logs output as text to pixel-based framebuffers.
33+
/// Provides a logger type that logs output as text to pixel-based framebuffers.
3434
pub mod logger;
3535

3636
// Contains the parsed configuration table from the kernel's Cargo.toml.
@@ -55,12 +55,12 @@ pub fn init_logger(framebuffer: &'static mut [u8], info: FrameBufferInfo) {
5555
log::set_max_level(log::LevelFilter::Trace);
5656
}
5757

58-
/// Required system information that should be queried from the BIOS or UEFI firmware.
58+
/// Required system information that should be queried from the BIOS or UEFI firmware.
5959
#[derive(Debug, Copy, Clone)]
6060
pub struct SystemInfo {
6161
/// Start address of the pixel-based framebuffer.
6262
pub framebuffer_addr: PhysAddr,
63-
/// Information about the framebuffer, including layout and pixel format.
63+
/// Information about the framebuffer, including layout and pixel format.
6464
pub framebuffer_info: FrameBufferInfo,
6565
/// Address of the _Root System Description Pointer_ structure of the ACPI standard.
6666
pub rsdp_addr: Option<PhysAddr>,
@@ -325,11 +325,14 @@ where
325325
version_patch: env!("CARGO_PKG_VERSION_PATCH").parse().unwrap(),
326326
pre_release: !env!("CARGO_PKG_VERSION_PRE").is_empty(),
327327
memory_regions: memory_regions.into(),
328-
framebuffer: mappings.framebuffer.map(|addr| FrameBuffer {
329-
buffer_start: addr.as_u64(),
330-
buffer_byte_len: system_info.framebuffer_info.byte_len,
331-
info: system_info.framebuffer_info,
332-
}).into(),
328+
framebuffer: mappings
329+
.framebuffer
330+
.map(|addr| FrameBuffer {
331+
buffer_start: addr.as_u64(),
332+
buffer_byte_len: system_info.framebuffer_info.byte_len,
333+
info: system_info.framebuffer_info,
334+
})
335+
.into(),
333336
physical_memory_offset: mappings.physical_memory_offset.map(VirtAddr::as_u64).into(),
334337
recursive_index: mappings.recursive_index.map(Into::into).into(),
335338
rsdp_addr: system_info.rsdp_addr.map(|addr| addr.as_u64()).into(),
@@ -421,7 +424,7 @@ unsafe fn context_switch(
421424
unreachable!();
422425
}
423426

424-
/// Memory addresses required for the context switch.
427+
/// Memory addresses required for the context switch.
425428
struct Addresses {
426429
page_table: PhysFrame,
427430
stack_top: VirtAddr,

src/boot_info.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ impl ops::Deref for MemoryRegions {
8383

8484
impl ops::DerefMut for MemoryRegions {
8585
fn deref_mut(&mut self) -> &mut Self::Target {
86-
unsafe { slice::from_raw_parts_mut(self.ptr, self.len )}
86+
unsafe { slice::from_raw_parts_mut(self.ptr, self.len) }
8787
}
8888
}
8989

@@ -98,7 +98,7 @@ impl From<&'static mut [MemoryRegion]> for MemoryRegions {
9898

9999
impl Into<&'static mut [MemoryRegion]> for MemoryRegions {
100100
fn into(self) -> &'static mut [MemoryRegion] {
101-
unsafe { slice::from_raw_parts_mut(self.ptr, self.len )}
101+
unsafe { slice::from_raw_parts_mut(self.ptr, self.len) }
102102
}
103103
}
104104

@@ -133,7 +133,7 @@ impl FrameBuffer {
133133
pub struct FrameBufferInfo {
134134
/// The total size in bytes.
135135
pub byte_len: usize,
136-
/// The width in pixels.
136+
/// The width in pixels.
137137
pub horizontal_resolution: usize,
138138
/// The height in pixels.
139139
pub vertical_resolution: usize,
@@ -149,7 +149,7 @@ pub struct FrameBufferInfo {
149149
pub stride: usize,
150150
}
151151

152-
/// Color format of pixels in the framebuffer.
152+
/// Color format of pixels in the framebuffer.
153153
#[derive(Debug, Clone, Copy)]
154154
#[non_exhaustive]
155155
#[repr(C)]

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct Config {
1919
/// Defaults to `false`.
2020
pub map_page_table_recursively: bool,
2121
/// Create the recursive mapping in at the given entry of the level 4 page table.
22-
///
22+
///
2323
/// If not given, the bootloader searches for a free level 4 entry dynamically.
2424
///
2525
/// Only considered if `map_page_table_recursively` is `true`.

0 commit comments

Comments
 (0)