various: cleanup
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I26df4d852b4b22d0df6b6871fe9cbde96a6a6964
This commit is contained in:
parent
f0aa256785
commit
4f9c7057ff
7 changed files with 778 additions and 62 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue