Skip to content

Commit 083dacf

Browse files
authored
Merge pull request #1914 from hermit-os/match_same_arms
fix: enable clippy::match_same_arms
2 parents aca59de + 407cb53 commit 083dacf

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
@@ -108,8 +108,9 @@ pub fn init_drivers() {
108108

109109
// TODO: Determine correct context via devicetree and allow more than one context
110110
match PLATFORM_MODEL {
111-
Model::Virt => init_plic(plic_region.starting_address as usize, 1),
112-
Model::Unknown => init_plic(plic_region.starting_address as usize, 1),
111+
Model::Virt | Model::Unknown => {
112+
init_plic(plic_region.starting_address as usize, 1);
113+
}
113114
Model::Fux40 => init_plic(plic_region.starting_address as usize, 2),
114115
}
115116
}

src/arch/x86_64/kernel/mod.rs

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

8383
pub fn args() -> Option<&'static str> {
8484
match env::boot_info().platform_info {
85-
PlatformInfo::Multiboot { command_line, .. } => command_line,
86-
PlatformInfo::LinuxBootParams { command_line, .. } => command_line,
85+
PlatformInfo::Multiboot { command_line, .. }
86+
| PlatformInfo::LinuxBootParams { command_line, .. } => command_line,
8787
_ => None,
8888
}
8989
}

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)