aboutsummaryrefslogtreecommitdiff
path: root/src/send.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/send.rs')
-rw-r--r--src/send.rs18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/send.rs b/src/send.rs
index a8cf966..f1df6f7 100644
--- a/src/send.rs
+++ b/src/send.rs
@@ -30,7 +30,7 @@ pub(crate) const ERROR_MARKER: ChunkLength = 0x4000;
pub(crate) const CHUNK_HAS_CONTINUATION: ChunkLength = 0x8000;
struct SendQueue {
- items: VecDeque<(u8, VecDeque<SendQueueItem>)>,
+ items: Vec<(u8, VecDeque<SendQueueItem>)>,
}
struct SendQueueItem {
@@ -42,7 +42,7 @@ struct SendQueueItem {
impl SendQueue {
fn new() -> Self {
Self {
- items: VecDeque::with_capacity(64),
+ items: Vec::with_capacity(64),
}
}
fn push(&mut self, item: SendQueueItem) {
@@ -56,20 +56,6 @@ impl SendQueue {
};
self.items[pos_prio].1.push_back(item);
}
- // used only in tests. They should probably be rewriten
- #[allow(dead_code)]
- fn pop(&mut self) -> Option<SendQueueItem> {
- match self.items.pop_front() {
- None => None,
- Some((prio, mut items_at_prio)) => {
- let ret = items_at_prio.pop_front();
- if !items_at_prio.is_empty() {
- self.items.push_front((prio, items_at_prio));
- }
- ret.or_else(|| self.pop())
- }
- }
- }
fn is_empty(&self) -> bool {
self.items.iter().all(|(_k, v)| v.is_empty())
}