Skip to content

Commit

Permalink
style: fix clippy and other warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Nov 16, 2022
1 parent 97ab38c commit 34915b5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 21 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {

// Build our helloworld.wast into binary.
let binary = wat::parse_file("src/helloworld.wast")?;
fs::write(out_dir.join("helloworld.wasm"), &binary)?;
fs::write(out_dir.join("helloworld.wasm"), binary)?;

println!("cargo:rerun-if-changed=src/helloworld.wast");
println!("cargo:rerun-if-changed=x86_64-mycelium.json");
Expand Down
10 changes: 2 additions & 8 deletions hal-x86_64/src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,14 +546,8 @@ impl hal_core::interrupt::Control for Idt {
self.set_isr(Self::PIC_PS2_KEYBOARD, keyboard_isr::<H> as *const ());
self.set_isr(Self::IOAPIC_PS2_KEYBOARD, keyboard_isr::<H> as *const ());
// local APIC specific hardware itnerrupts
self.set_isr(
Self::LOCAL_APIC_SPURIOUS as usize,
spurious_isr as *const (),
);
self.set_isr(
Self::LOCAL_APIC_TIMER as usize,
apic_timer_isr::<H> as *const (),
);
self.set_isr(Self::LOCAL_APIC_SPURIOUS, spurious_isr as *const ());
self.set_isr(Self::LOCAL_APIC_TIMER, apic_timer_isr::<H> as *const ());

// vector 69 (nice) is reserved by the HAL for testing the IDT.
self.set_isr(69, test_isr::<H> as *const ());
Expand Down
4 changes: 4 additions & 0 deletions pci/src/express.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// this module is mostly not yet implemented...
#![allow(dead_code)]
use crate::{
device::{self, CardBusDetails, PciBridgeDetails, StandardDetails},
register,
Expand All @@ -21,6 +23,8 @@ impl<'device> MemoryMappedDevice<'device> {
}

pub fn send_command(&mut self, command: register::Command) {
// suppress unused warning
let _ = command;
todo!()
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/arch/x86_64.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use alloc::boxed::Box;
use core::cell::RefCell;
use hal_core::boot::BootInfo;
use hal_x86_64::{
cpu::{self, local::GsLocalData},
Expand Down
20 changes: 10 additions & 10 deletions trace/src/buf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,19 +365,19 @@ mod tests {
}

fn test_range_iters(buf: &LineBuf, expected: &[&str]) {
assert_slicelike("unbounded", &buf, &expected, ..);
assert_slicelike("unbounded", buf, expected, ..);

assert_slicelike("start inclusive", &buf, &expected, 2..);
assert_slicelike("start inclusive", &buf, &expected, 3..);
assert_slicelike("start inclusive", &buf, &expected, 4..);
assert_slicelike("start inclusive", &buf, &expected, 5..);
assert_slicelike("start inclusive", buf, expected, 2..);
assert_slicelike("start inclusive", buf, expected, 3..);
assert_slicelike("start inclusive", buf, expected, 4..);
assert_slicelike("start inclusive", buf, expected, 5..);

assert_slicelike("end inclusive", &buf, &expected, ..=2);
assert_slicelike("end inclusive", &buf, &expected, ..=5);
assert_slicelike("end inclusive", buf, expected, ..=2);
assert_slicelike("end inclusive", buf, expected, ..=5);

assert_slicelike("end exclusive", &buf, &expected, ..2);
assert_slicelike("end exclusive", &buf, &expected, ..5);
assert_slicelike("end exclusive", &buf, &expected, ..6)
assert_slicelike("end exclusive", buf, expected, ..2);
assert_slicelike("end exclusive", buf, expected, ..5);
assert_slicelike("end exclusive", buf, expected, ..6)
}

fn fill(mut buf: &mut LineBuf, strs: &[&str]) {
Expand Down

0 comments on commit 34915b5

Please sign in to comment.