From 25696e39d11f89317e4fb921f07b2b675bd5f699 Mon Sep 17 00:00:00 2001 From: David Durieux Date: Sat, 6 Jul 2024 12:18:54 +0200 Subject: [PATCH] Fix --- src/module/localinventory/data/cpu/dmidecode.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/module/localinventory/data/cpu/dmidecode.rs b/src/module/localinventory/data/cpu/dmidecode.rs index 43270a8..3b927c3 100644 --- a/src/module/localinventory/data/cpu/dmidecode.rs +++ b/src/module/localinventory/data/cpu/dmidecode.rs @@ -70,6 +70,7 @@ fn parse_output(out: String) -> Vec { let mut processors = Vec::new(); // get each part of dmidecode to identify processor / processors + let out = out.replace("\r\n", "\n"); let parts = out.split("\n\n"); for part in parts { let result = part.to_string().indent_to_json(); @@ -197,7 +198,7 @@ fn run_dmidecode_cmd() -> String { // split let empty = String::from(""); match String::from_utf8(output.stdout) { - Ok(x) => x.replace("\r\n", "\n"), + Ok(x) => x, Err(_) => empty, } }