reflect: reflect

This commit is contained in:
2020-10-18 22:55:41 +08:00
parent acd45e75f6
commit fdbb1b9443

View File

@@ -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))
}