Skip to content

Commit

Permalink
Merge pull request #250 from mkroening/format-imports
Browse files Browse the repository at this point in the history
Format imports
  • Loading branch information
mkroening authored Aug 8, 2023
2 parents e7a1b69 + 8bdd738 commit da7e127
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check Formatting
Expand Down
1 change: 0 additions & 1 deletion .rustfmt.toml

This file was deleted.

3 changes: 3 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
group_imports = "StdExternalCrate"
hard_tabs = true
imports_granularity = "Module"
8 changes: 3 additions & 5 deletions src/arch/aarch64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ use core::arch::asm;

use goblin::elf::header::header64::{Header, EI_DATA, ELFDATA2LSB, ELFMAG, SELFMAG};
use hermit_dtb::Dtb;
use hermit_entry::{
boot_info::{BootInfo, HardwareInfo, PlatformInfo, RawBootInfo, SerialPortBase},
elf::LoadedKernel,
Entry,
};
use hermit_entry::boot_info::{BootInfo, HardwareInfo, PlatformInfo, RawBootInfo, SerialPortBase};
use hermit_entry::elf::LoadedKernel;
use hermit_entry::Entry;
use log::info;

use crate::arch::paging::*;
Expand Down
7 changes: 3 additions & 4 deletions src/arch/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::*;
#[cfg(target_arch = "x86_64")]
pub use crate::arch::x86_64::*;

#[cfg(target_arch = "aarch64")]
pub use crate::arch::aarch64::*;
pub mod aarch64;

#[cfg(target_arch = "x86_64")]
pub mod x86_64;

#[cfg(target_arch = "aarch64")]
pub mod aarch64;
8 changes: 3 additions & 5 deletions src/arch/x86_64/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ use core::ptr::write_bytes;
#[cfg(target_os = "none")]
use core::slice;

use hermit_entry::boot_info::{BootInfo, HardwareInfo, PlatformInfo, RawBootInfo, SerialPortBase};
use hermit_entry::elf::LoadedKernel;
#[cfg(all(target_os = "none", feature = "fc"))]
use hermit_entry::fc::{
BOOT_FLAG_OFFSET, CMD_LINE_PTR_OFFSET, CMD_LINE_SIZE_OFFSET, E820_ENTRIES_OFFSET,
E820_TABLE_OFFSET, HDR_MAGIC_OFFSET, LINUX_KERNEL_BOOT_FLAG_MAGIC, LINUX_KERNEL_HRD_MAGIC,
LINUX_SETUP_HEADER_OFFSET, RAMDISK_IMAGE_OFFSET, RAMDISK_SIZE_OFFSET,
};
use hermit_entry::{
boot_info::{BootInfo, HardwareInfo, PlatformInfo, RawBootInfo, SerialPortBase},
elf::LoadedKernel,
Entry,
};
use hermit_entry::Entry;
use log::info;
#[cfg(all(target_os = "none", not(feature = "fc")))]
use multiboot::information::MemoryManagement;
Expand Down
3 changes: 2 additions & 1 deletion src/arch/x86_64/paging.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use core::fmt::Debug;

use x86_64::structures::paging::mapper::CleanUp;
use x86_64::structures::paging::{
mapper::CleanUp, Mapper, Page, PageSize, PageTableFlags, PhysFrame, RecursivePageTable,
Mapper, Page, PageSize, PageTableFlags, PhysFrame, RecursivePageTable,
};

use super::physicalmem::PhysAlloc;
Expand Down
11 changes: 6 additions & 5 deletions src/none.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use crate::arch;
use crate::console;
use core::fmt::Write;
use core::mem::MaybeUninit;
use core::ptr::addr_of_mut;
use core::slice;

use hermit_entry::elf::KernelObject;

use core::{fmt::Write, mem::MaybeUninit, ptr::addr_of_mut, slice};

use log::info;

use crate::{arch, console};

extern "C" {
static kernel_end: u8;
static kernel_start: u8;
Expand Down
8 changes: 3 additions & 5 deletions xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
mod flags;
mod target;

use std::{
env::{self, VarError},
ffi::OsStr,
path::{Path, PathBuf},
};
use std::env::{self, VarError};
use std::ffi::OsStr;
use std::path::{Path, PathBuf};

use anyhow::{anyhow, Result};
use llvm_tools::LlvmTools;
Expand Down

0 comments on commit da7e127

Please sign in to comment.