Skip to content

Commit

Permalink
another 'let else'
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Sep 2, 2024
1 parent 77c4115 commit 5615ab7
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions capnp-rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2117,17 +2117,13 @@ impl Params {
impl ParamsHook for Params {
fn get(&self) -> ::capnp::Result<any_pointer::Reader> {
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)
}
}

Expand Down

0 comments on commit 5615ab7

Please sign in to comment.