Skip to content

Commit

Permalink
style: fix Rust 1.65 clippy lints (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Nov 16, 2022
1 parent 56ffa09 commit 5e5ee6b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ 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)?;
Ok(())
}
2 changes: 1 addition & 1 deletion hal-core/src/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub trait Address:
return self;
}
let aligned = (u | mask) + 1;
Self::from_usize(aligned as usize)
Self::from_usize(aligned)
}

/// Align `self` up to the required alignment for a value of type `T`.
Expand Down
2 changes: 1 addition & 1 deletion hal-x86_64/src/interrupt/idt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ mod tests {
// Z: this bit is 0 for a 64-bit IDT. for a 32-bit IDT, this may be 1 for task gates.
// Gate Type: 32-bit interrupt gate is 0b1110. that's just how it is.
assert_eq!(
present_32bit_interrupt.0 as u8, 0b1000_1110,
present_32bit_interrupt.0, 0b1000_1110,
"\n attrs: {:#?}",
present_32bit_interrupt
);
Expand Down
4 changes: 2 additions & 2 deletions inoculate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ impl Options {
let mut cmd = self.cargo_cmd("builder");
cmd.current_dir(run_dir)
.arg("--kernel-manifest")
.arg(&paths.kernel_manifest())
.arg(paths.kernel_manifest())
.arg("--kernel-binary")
.arg(&paths.kernel_bin())
.arg(paths.kernel_bin())
.arg("--out-dir")
.arg(out_dir)
.arg("--target-dir")
Expand Down
7 changes: 2 additions & 5 deletions maitake/src/time/timer/wheel/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ fn wheel_indices() {
)
}

for wheel in 1..Core::WHEELS as usize {
for wheel in 1..Core::WHEELS {
for slot in wheel..Wheel::SLOTS {
let ticks = (slot * usize::pow(Wheel::SLOTS, wheel as u32)) as u64;
assert_eq!(
Expand Down Expand Up @@ -60,10 +60,7 @@ fn slot_indices() {
for i in level..Wheel::SLOTS {
let ticks = i * usize::pow(Wheel::SLOTS, level as u32);
let slot_index = wheel.slot_index(ticks as u64);
assert_eq!(
i as usize, slot_index,
"wheels[{level}].slot_index({ticks}) == {i}"
)
assert_eq!(i, slot_index, "wheels[{level}].slot_index({ticks}) == {i}")
}
}
}
Expand Down

0 comments on commit 5e5ee6b

Please sign in to comment.