diff --git a/Cargo.toml b/Cargo.toml index 1ba57bc..df814a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/main.rs b/src/main.rs index e13669e..e0c9e24 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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}"), } } }