reflect: reflect
This commit is contained in:
11
src/main.rs
11
src/main.rs
@@ -211,11 +211,8 @@ fn ps_aux() -> Option<String> {
|
||||
error!("Run 'ps aux' error: {:?}", output.status);
|
||||
return None;
|
||||
}
|
||||
match String::from_utf8(output.stdout) {
|
||||
Ok(output_str) => Some(output_str),
|
||||
Err(err) => {
|
||||
error!("Get ps output as utf8 error: {}", err);
|
||||
None
|
||||
},
|
||||
}
|
||||
String::from_utf8(output.stdout).map_or_else(|err| {
|
||||
error!("Get ps output as utf8 error: {}", err);
|
||||
None
|
||||
}, |output_str| Some(output_str))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user