Remove unused serialization support for LinkedList.

This commit is contained in:
Nicholas Nethercote 2023-10-05 20:59:15 +11:00
parent 3ee67475b2
commit f703475b4e

View File

@ -2,7 +2,7 @@
use crate::{Decodable, Decoder, Encodable, Encoder};
use smallvec::{Array, SmallVec};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, LinkedList, VecDeque};
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque};
use std::hash::{BuildHasher, Hash};
use std::rc::Rc;
use std::sync::Arc;
@ -35,22 +35,6 @@ fn decode(d: &mut D) -> ThinVec<T> {
}
}
impl<S: Encoder, T: Encodable<S>> Encodable<S> for LinkedList<T> {
fn encode(&self, s: &mut S) {
s.emit_usize(self.len());
for e in self.iter() {
e.encode(s);
}
}
}
impl<D: Decoder, T: Decodable<D>> Decodable<D> for LinkedList<T> {
fn decode(d: &mut D) -> LinkedList<T> {
let len = d.read_usize();
(0..len).map(|_| Decodable::decode(d)).collect()
}
}
impl<S: Encoder, T: Encodable<S>> Encodable<S> for VecDeque<T> {
fn encode(&self, s: &mut S) {
s.emit_usize(self.len());