Skip to content

Commit c4684fb

Browse files
Simplify code into 1 statement
Signed-off-by: erikness-doordash <[email protected]>
1 parent bbc50f2 commit c4684fb

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/dispatcher.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,7 @@ impl Dispatcher {
428428
}
429429

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

492490
fn on_grpc_receive_trailing_metadata(&self, token_id: u32, trailers: u32) {
493-
let grpc_streams_ref = self.grpc_streams.borrow_mut();
494-
let context_id_hash_slot = grpc_streams_ref.get(&token_id);
495-
let context_id = match context_id_hash_slot {
491+
let context_id = match self.grpc_streams.borrow_mut().get(&token_id) {
496492
Some(id) => *id,
497493
None => {
498494
// TODO: change back to a panic once underlying issue is fixed.

0 commit comments

Comments
 (0)