@@ -209,12 +209,12 @@ impl RequestManager {
209209 request_id : RequestId ,
210210 ) -> Option < ( RequestId , PendingSubscriptionOneshot , UnsubscribeMethod ) > {
211211 match self . requests . entry ( request_id) {
212- Entry :: Occupied ( request) if matches ! ( request . get ( ) , Kind :: PendingSubscription ( _ ) ) => {
212+ Entry :: Occupied ( request) => {
213213 let ( _req_id, kind) = request. remove_entry ( ) ;
214214 if let Kind :: PendingSubscription ( send_back) = kind {
215215 Some ( send_back)
216216 } else {
217- unreachable ! ( "Pending subscription is Pending subscription checked above; qed" ) ;
217+ None
218218 }
219219 }
220220 _ => None ,
@@ -239,12 +239,12 @@ impl RequestManager {
239239 /// Returns `Some` if the call was completed otherwise `None`.
240240 pub ( crate ) fn complete_pending_call ( & mut self , request_id : RequestId ) -> Option < PendingCallOneshot > {
241241 match self . requests . entry ( request_id) {
242- Entry :: Occupied ( request) if matches ! ( request . get ( ) , Kind :: PendingMethodCall ( _ ) ) => {
242+ Entry :: Occupied ( request) => {
243243 let ( _req_id, kind) = request. remove_entry ( ) ;
244244 if let Kind :: PendingMethodCall ( send_back) = kind {
245245 Some ( send_back)
246246 } else {
247- unreachable ! ( "Pending call is Pending call checked above; qed" ) ;
247+ None
248248 }
249249 }
250250 _ => None ,
@@ -261,16 +261,14 @@ impl RequestManager {
261261 subscription_id : SubscriptionId < ' static > ,
262262 ) -> Option < ( RequestId , SubscriptionSink , UnsubscribeMethod , SubscriptionId ) > {
263263 match ( self . requests . entry ( request_id) , self . subscriptions . entry ( subscription_id) ) {
264- ( Entry :: Occupied ( mut request) , Entry :: Occupied ( subscription) )
265- if matches ! ( request. get( ) , Kind :: Subscription ( _) ) =>
266- {
264+ ( Entry :: Occupied ( mut request) , Entry :: Occupied ( subscription) ) => {
267265 // Mark the request ID as pending unsubscription.
268266 let kind = std:: mem:: replace ( request. get_mut ( ) , Kind :: PendingMethodCall ( None ) ) ;
269267 let ( sub_id, _req_id) = subscription. remove_entry ( ) ;
270268 if let Kind :: Subscription ( ( unsub_req_id, send_back, unsub) ) = kind {
271269 Some ( ( unsub_req_id, send_back, unsub, sub_id) )
272270 } else {
273- unreachable ! ( "Subscription is Subscription checked above; qed" ) ;
271+ None
274272 }
275273 }
276274 _ => None ,
0 commit comments