diff --git a/Cargo.lock b/Cargo.lock index fc54a89..df23272 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -284,7 +284,7 @@ checksum = "6aa2c4e539b869820a2b82e1aef6ff40aa85e65decdd5185e83fb4b1249cd00f" [[package]] name = "nyanit" -version = "0.2.5" +version = "0.2.6" dependencies = [ "nix", "ratatui", diff --git a/Cargo.toml b/Cargo.toml index f215641..918fa8a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "nyanit" -version = "0.2.5" +version = "0.2.6" edition = "2024" [dependencies] diff --git a/src/nyan_system.rs b/src/nyan_system.rs index 1894fb0..6c9b53c 100644 --- a/src/nyan_system.rs +++ b/src/nyan_system.rs @@ -186,11 +186,11 @@ pub fn find_partlabel(partlabel: &str) -> Result, ExecCommandEr ]) .output()?; if out.status.success() { - let re = Regex::new(r#"^(/dev/[a-z0-9-]+): TYPE="([a-z]+)" PARTLABEL="[a-z0-9-]+"$"#) + let re = Regex::new(r#"^(/dev/[a-z0-9-]+): TYPE="([a-z]+)" PARTLABEL="[a-z0-9-]+""#) .unwrap(); let out_text = String::from_utf8(out.stdout)?; - - if let Some(captured) = re.captures(&out_text) { + let out_text_trimmed = out_text.trim(); + if let Some(captured) = re.captures(out_text_trimmed) { // let part_no = captured[1]; // let parent_dev = captured[2]; let res = BlkIdRes{ fs_type: captured[2].to_string(), dev_node: captured[1].to_string()};