File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -771,15 +771,15 @@ impl<VatId> ConnectionState<VatId> {
771
771
let mut exports_to_release = Vec :: new ( ) ;
772
772
let answer_id = finish. get_question_id ( ) ;
773
773
774
- let mut erase = false ;
775
774
let answers_slots = & mut connection_state. answers . borrow_mut ( ) . slots ;
776
- match answers_slots. get_mut ( & answer_id) {
777
- None => {
775
+ match answers_slots. entry ( answer_id) {
776
+ hash_map :: Entry :: Vacant ( _ ) => {
778
777
return Err ( Error :: failed ( format ! (
779
778
"Invalid question ID {answer_id} in Finish message."
780
779
) ) ) ;
781
780
}
782
- Some ( answer) => {
781
+ hash_map:: Entry :: Occupied ( mut entry) => {
782
+ let answer = entry. get_mut ( ) ;
783
783
answer. received_finish . set ( true ) ;
784
784
785
785
if finish. get_release_result_caps ( ) {
@@ -791,15 +791,11 @@ impl<VatId> ConnectionState<VatId> {
791
791
answer. call_completion_promise . take ( ) ;
792
792
793
793
if answer. return_has_been_sent {
794
- erase = true ;
794
+ entry . remove ( ) ;
795
795
}
796
796
}
797
797
}
798
798
799
- if erase {
800
- answers_slots. remove ( & answer_id) ;
801
- }
802
-
803
799
connection_state. release_exports ( & exports_to_release) ?;
804
800
Ok ( ( ) )
805
801
}
You can’t perform that action at this time.
0 commit comments