diff --git a/src/dispatcher.rs b/src/dispatcher.rs index b48ff88a..a1bbc7eb 100644 --- a/src/dispatcher.rs +++ b/src/dispatcher.rs @@ -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. @@ -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.