various: cleanup

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I26df4d852b4b22d0df6b6871fe9cbde96a6a6964
This commit is contained in:
raf 2026-02-18 21:08:00 +03:00
commit 4f9c7057ff
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
7 changed files with 778 additions and 62 deletions

View file

@ -61,24 +61,17 @@ impl ProcessHelper {
.collect::<Vec<_>>()
.join(" ");
} else if line.starts_with("State:") {
state = line
.split_whitespace()
.skip(1)
.next()
.unwrap_or("")
.to_string();
state = line.split_whitespace().nth(1).unwrap_or("").to_string();
} else if line.starts_with("PPid:") {
ppid = line
.split_whitespace()
.skip(1)
.next()
.nth(1)
.and_then(|s| s.parse().ok())
.unwrap_or(0);
} else if line.starts_with("VmRSS:") {
memory_kb = line
.split_whitespace()
.skip(1)
.next()
.nth(1)
.and_then(|s| s.parse().ok())
.unwrap_or(0);
}