1 use alloc::collections::VecDeque;
2 
3 use super::Buf;
4 
5 impl Buf for VecDeque<u8> {
remaining(&self) -> usize6     fn remaining(&self) -> usize {
7         self.len()
8     }
9 
bytes(&self) -> &[u8]10     fn bytes(&self) -> &[u8] {
11         let (s1, s2) = self.as_slices();
12         if s1.is_empty() {
13             s2
14         } else {
15             s1
16         }
17     }
18 
advance(&mut self, cnt: usize)19     fn advance(&mut self, cnt: usize) {
20         self.drain(..cnt);
21     }
22 }
23