hive-m1nd: if-let-else instead of match

This commit is contained in:
müde 2026-05-15 00:27:47 +02:00
parent 1ceabae892
commit 2267800c51

View file

@ -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");