hive-m1nd: if-let-else instead of match
This commit is contained in:
parent
1ceabae892
commit
2267800c51
1 changed files with 4 additions and 3 deletions
|
|
@ -95,9 +95,10 @@ async fn serve(socket: &Path, interval: Duration) -> Result<()> {
|
||||||
match recv {
|
match recv {
|
||||||
Ok(ManagerResponse::Message { from, body }) => {
|
Ok(ManagerResponse::Message { from, body }) => {
|
||||||
if from == SYSTEM_SENDER {
|
if from == SYSTEM_SENDER {
|
||||||
match serde_json::from_str::<HelperEvent>(&body) {
|
if let Ok(event) = serde_json::from_str::<HelperEvent>(&body) {
|
||||||
Ok(event) => tracing::info!(?event, "helper event"),
|
tracing::info!(?event, "helper event");
|
||||||
Err(_) => tracing::info!(%from, %body, "system message"),
|
} else {
|
||||||
|
tracing::info!(%from, %body, "system message");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tracing::info!(%from, %body, "manager inbox");
|
tracing::info!(%from, %body, "manager inbox");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue