Delete Decoder::read_map_elt_val

This commit is contained in:
Mark Rousskov 2022-02-09 17:44:54 -05:00
parent 025e1b581a
commit 8def096c4d
2 changed files with 3 additions and 11 deletions

View File

@ -82,7 +82,7 @@ where
let mut map = BTreeMap::new();
for _ in 0..len {
let key = Decodable::decode(d);
let val = d.read_map_elt_val(|d| Decodable::decode(d));
let val = Decodable::decode(d);
map.insert(key, val);
}
map
@ -148,7 +148,7 @@ where
let mut map = HashMap::with_capacity_and_hasher(len, state);
for _ in 0..len {
let key = Decodable::decode(d);
let val = d.read_map_elt_val(|d| Decodable::decode(d));
let val = Decodable::decode(d);
map.insert(key, val);
}
map
@ -227,7 +227,7 @@ where
let mut map = indexmap::IndexMap::with_capacity_and_hasher(len, state);
for _ in 0..len {
let key = Decodable::decode(d);
let val = d.read_map_elt_val(|d| Decodable::decode(d));
let val = Decodable::decode(d);
map.insert(key, val);
}
map

View File

@ -225,14 +225,6 @@ pub trait Decoder {
let len = self.read_usize();
f(self, len)
}
#[inline]
fn read_map_elt_val<T, F>(&mut self, f: F) -> T
where
F: FnOnce(&mut Self) -> T,
{
f(self)
}
}
/// Trait for types that can be serialized