Refactor device reset logic to use match statement for better clarity
All checks were successful
/ release (nightly) (push) Successful in 1m55s

This commit is contained in:
Edgar P. Burkhart 2025-05-14 16:30:03 +02:00
parent 28ffb56665
commit 8209da3b21
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
2 changed files with 4 additions and 3 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "phenix"
description = "Utility to restart PCIe devices when link is lost."
version = "0.1.4"
version = "0.1.5"
edition = "2024"
license = "GPL-3.0-or-later"
repository="https://code.edgarpierre.fr/edpibu/phenix"

View file

@ -23,8 +23,9 @@ fn manage_line(line: String) {
println!("PCIe link lost {prefix}");
let id = line.splitn(3, " ").nth(1);
if let Some(id) = id {
reset_device(id);
match id {
Some(id) => reset_device(id),
None => println!("No device id found in message {line}"),
}
}
}