mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Delete Decoder::read_map_elt_val
This commit is contained in:
parent
025e1b581a
commit
8def096c4d
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user