Skip to content

Commit

Permalink
Simplify code into 1 statement
Browse files Browse the repository at this point in the history
Signed-off-by: erikness-doordash <[email protected]>
  • Loading branch information
erikness-doordash committed Oct 25, 2023
1 parent bbc50f2 commit c4684fb
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,9 +428,7 @@ impl Dispatcher {
}

fn on_grpc_receive_initial_metadata(&self, token_id: u32, headers: u32) {
let grpc_streams_ref = self.grpc_streams.borrow_mut();
let context_id_hash_slot = grpc_streams_ref.get(&token_id);
let context_id = match context_id_hash_slot {
let context_id = match self.grpc_streams.borrow_mut().get(&token_id) {
Some(id) => *id,
None => {
// TODO: change back to a panic once underlying issue is fixed.
Expand Down Expand Up @@ -490,9 +488,7 @@ impl Dispatcher {
}

fn on_grpc_receive_trailing_metadata(&self, token_id: u32, trailers: u32) {
let grpc_streams_ref = self.grpc_streams.borrow_mut();
let context_id_hash_slot = grpc_streams_ref.get(&token_id);
let context_id = match context_id_hash_slot {
let context_id = match self.grpc_streams.borrow_mut().get(&token_id) {
Some(id) => *id,
None => {
// TODO: change back to a panic once underlying issue is fixed.
Expand Down

0 comments on commit c4684fb

Please sign in to comment.