pub fn pop_front(&mut self, key_hash: u64) -> Option<(u64, u64)> {
        if let Some(item) = self.waiting.pop_front() {
            if let Some((k, _)) = item.as_ref() {
                if *k == key_hash {
                    self.maybe_shrink();
                    return item;
                }
                self.waiting.push_front(item);
            }
            // FIXME: remove this clippy attribute once https://github.com/rust-lang/rust-clippy/issues/6784 is fixed.
            #[allow(clippy::manual_flatten)]
            for it in self.waiting.iter_mut() {
                if let Some((v, _)) = it {
                    if *v == key_hash {
                        return it.take();
                    }
                }
            }
        }
        None
    }
/// Remove the first command ID in the queue whose hash value is equal to hash_key.
/// If the element which would be removed does not appear at the front of the queue, it will leave
/// a hole in the queue. So we must remove consecutive hole when remove the head of the
/// queue to make the queue not too long.
Remove the first command ID in the queue whose hash value is equal to hash_key.
If the element which would be removed does not appear at the front of the queue, it will leave
a hole in the queue. So we must remove consecutive hole when remove the head of the
queue to make the queue not too long.
Remove the first command ID in the queue whose hash value is equal to hash_key . If the element which would be removed does not appear at the front of the queue it will leave a hole in the queue . So we must remove consecutive hole when remove the head of the queue to make the queue not too long .
pub fn pop_front(&mut self, key_hash: u64) -> Option<(u64, u64)> {
        if let Some(item) = self.waiting.pop_front() {
            if let Some((k, _)) = item.as_ref() {
                if *k == key_hash {
                    self.maybe_shrink();
                    return item;
                }
                self.waiting.push_front(item);
            }
            // FIXME: remove this clippy attribute once https://github.com/rust-lang/rust-clippy/issues/6784 is fixed.
            #[allow(clippy::manual_flatten)]
            for it in self.waiting.iter_mut() {
                if let Some((v, _)) = it {
                    if *v == key_hash {
                        return it.take();
                    }
                }
            }
        }
        None
    }
pub fn pop_front ( & mut self , key_hash : u64 ) -> Option < ( u64 , u64 ) > { if let Some ( item ) = self . waiting . pop_front ( ) { if let Some ( ( k , _ ) ) = item . as_ref ( ) { if * k == key_hash { self . maybe_shrink ( ) ; return item ; } self . waiting . push_front ( item ) ; } // FIXME: remove this clippy attribute once https://github.com/rust-lang/rust-clippy/issues/6784 is fixed. # [ allow ( clippy manual_flatten ) ] for it in self . waiting . iter_mut ( ) { if let Some ( ( v , _ ) ) = it { if * v == key_hash { return it . take ( ) ; } } } } None }
Remove the first command ID in the queue whose hash value is equal to hash_key.
Remove the first command ID in the queue whose hash value is equal to hash_key .
&mut self
key_hash
u64