From 5615ab70bdced110cf77b8926a122ac4e7c5064b Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Mon, 2 Sep 2024 11:22:44 -0400 Subject: [PATCH] another 'let else' --- capnp-rpc/src/rpc.rs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/capnp-rpc/src/rpc.rs b/capnp-rpc/src/rpc.rs index d537c0b40..100b06643 100644 --- a/capnp-rpc/src/rpc.rs +++ b/capnp-rpc/src/rpc.rs @@ -2117,17 +2117,13 @@ impl Params { impl ParamsHook for Params { fn get(&self) -> ::capnp::Result { let root: message::Reader = self.request.get_body()?.get_as()?; - match root.which()? { - message::Call(call) => { - use ::capnp::traits::Imbue; - let mut content = call?.get_params()?.get_content(); - content.imbue(&self.cap_table); - Ok(content) - } - _ => { - unreachable!() - } - } + let message::Call(call) = root.which()? else { + unreachable!() + }; + use ::capnp::traits::Imbue; + let mut content = call?.get_params()?.get_content(); + content.imbue(&self.cap_table); + Ok(content) } }