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); error!("Run 'ps aux' error: {:?}", output.status);
return None; return None;
} }
match String::from_utf8(output.stdout) { String::from_utf8(output.stdout).map_or_else(|err| {
Ok(output_str) => Some(output_str),
Err(err) => {
error!("Get ps output as utf8 error: {}", err); error!("Get ps output as utf8 error: {}", err);
None None
}, }, |output_str| Some(output_str))
}
} }