Skip to content

Commit 407cb53

Browse files
committed
fix: enable clippy::match_same_arms
1 parent 8c012c6 commit 407cb53

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ implicit_clone = "warn"
9494
inconsistent_struct_constructor = "warn"
9595
manual_assert = "warn"
9696
manual_let_else = "warn"
97+
match_same_arms = "warn"
9798
match_wildcard_for_single_variants = "warn"
9899
ptr_as_ptr = "warn"
99100
ptr_cast_constness = "warn"

src/arch/riscv64/kernel/devicetree.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,9 @@ pub fn init_drivers() {
145145

146146
// TODO: Determine correct context via devicetree and allow more than one context
147147
match PLATFORM_MODEL {
148-
Model::Virt => init_plic(plic_region.starting_address as usize, 1),
149-
Model::Unknown => init_plic(plic_region.starting_address as usize, 1),
148+
Model::Virt | Model::Unknown => {
149+
init_plic(plic_region.starting_address as usize, 1);
150+
}
150151
Model::Fux40 => init_plic(plic_region.starting_address as usize, 2),
151152
}
152153
}

src/arch/x86_64/kernel/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ pub fn is_uhyve_with_pci() -> bool {
8888

8989
pub fn args() -> Option<&'static str> {
9090
match env::boot_info().platform_info {
91-
PlatformInfo::Multiboot { command_line, .. } => command_line,
92-
PlatformInfo::LinuxBootParams { command_line, .. } => command_line,
91+
PlatformInfo::Multiboot { command_line, .. }
92+
| PlatformInfo::LinuxBootParams { command_line, .. } => command_line,
9393
_ => None,
9494
}
9595
}

src/drivers/net/gem.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,7 @@ pub fn init_device(
673673
warn! {"No PHY address provided. Trying to find PHY ..."}
674674
for i in 0..32 {
675675
match phy_read(gem, i, PhyReg::Control) {
676-
0xffff => (), //Invalid
677-
0x0 => (), //Invalid
676+
0xffff | 0x0 => (), //Invalid
678677
_ => {
679678
phy_addr = i;
680679
warn!("PHY found with address {phy_addr}");

0 commit comments

Comments
 (0)