Skip to content

Commit

Permalink
one more 'let else'
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Sep 2, 2024
1 parent 5615ab7 commit 54438d5
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions capnp-rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2470,21 +2470,15 @@ impl ResultsDoneHook for ResultsDone {
match *self.inner {
ResultsDoneVariant::Rpc(ref message, ref cap_table) => {
let root: message::Reader = message.get_root_as_reader()?;
match root.which()? {
message::Return(ret) => match ret?.which()? {
crate::rpc_capnp::return_::Results(payload) => {
let mut content = payload?.get_content();
content.imbue(cap_table);
Ok(content)
}
_ => {
unreachable!()
}
},
_ => {
unreachable!()
}
}
let message::Return(ret) = root.which()? else {
unreachable!();
};
let crate::rpc_capnp::return_::Results(payload) = ret?.which()? else {
unreachable!();
};
let mut content = payload?.get_content();
content.imbue(cap_table);
Ok(content)
}
ResultsDoneVariant::LocallyRedirected(ref message, ref cap_table) => {
let mut result: any_pointer::Reader = message.get_root_as_reader()?;
Expand Down

0 comments on commit 54438d5

Please sign in to comment.