fn take_ready_service(&mut self, key: &D::Key) -> Option<D::Service> {
        if let Some(svc) = self.ready_services.remove(key) {
            if Some(*key) == self.preselected_p2c_peer {
                self.preselected_p2c_peer = None;
            }

            assert!(
                !self.cancel_handles.contains_key(key),
                "cancel handles are only used for unready service work"
            );

            Some(svc)
        } else {
            None
        }
    }
/// Takes a ready service by key, invalidating `preselected_p2c_peer` if needed.
Takes a ready service by key, invalidating `preselected_p2c_peer` if needed.
Takes a ready service by key invalidating ` preselected_p2c_peer ` if needed .
fn take_ready_service(&mut self, key: &D::Key) -> Option<D::Service> {
        if let Some(svc) = self.ready_services.remove(key) {
            if Some(*key) == self.preselected_p2c_peer {
                self.preselected_p2c_peer = None;
            }
            assert!(
                !self.cancel_handles.contains_key(key),
                "cancel handles are only used for unready service work"
            );
            Some(svc)
        } else {
            None
        }
    }
fn take_ready_service ( & mut self , key : & D :: Key ) -> Option < D :: Service > { if let Some ( svc ) = self . ready_services . remove ( key ) { if Some ( * key ) == self . preselected_p2c_peer { self . preselected_p2c_peer = None ; } assert ! ( self cancel_handles contains_key ( key ) " " ) ; Some ( svc ) } else { None } }
Takes a ready service by key, invalidating `preselected_p2c_peer` if needed.
Takes a ready service by key invalidating ` preselected_p2c_peer ` if needed .
&mut self
key
&D::Key