mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Delete Decoder::read_map_elt_key
This commit is contained in:
parent
38e6dad1d3
commit
025e1b581a
@ -81,7 +81,7 @@ where
|
||||
d.read_map(|d, len| {
|
||||
let mut map = BTreeMap::new();
|
||||
for _ in 0..len {
|
||||
let key = d.read_map_elt_key(|d| Decodable::decode(d));
|
||||
let key = Decodable::decode(d);
|
||||
let val = d.read_map_elt_val(|d| Decodable::decode(d));
|
||||
map.insert(key, val);
|
||||
}
|
||||
@ -147,7 +147,7 @@ where
|
||||
let state = Default::default();
|
||||
let mut map = HashMap::with_capacity_and_hasher(len, state);
|
||||
for _ in 0..len {
|
||||
let key = d.read_map_elt_key(|d| Decodable::decode(d));
|
||||
let key = Decodable::decode(d);
|
||||
let val = d.read_map_elt_val(|d| Decodable::decode(d));
|
||||
map.insert(key, val);
|
||||
}
|
||||
@ -226,7 +226,7 @@ where
|
||||
let state = Default::default();
|
||||
let mut map = indexmap::IndexMap::with_capacity_and_hasher(len, state);
|
||||
for _ in 0..len {
|
||||
let key = d.read_map_elt_key(|d| Decodable::decode(d));
|
||||
let key = Decodable::decode(d);
|
||||
let val = d.read_map_elt_val(|d| Decodable::decode(d));
|
||||
map.insert(key, val);
|
||||
}
|
||||
|
@ -226,14 +226,6 @@ pub trait Decoder {
|
||||
f(self, len)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn read_map_elt_key<T, F>(&mut self, f: F) -> T
|
||||
where
|
||||
F: FnOnce(&mut Self) -> T,
|
||||
{
|
||||
f(self)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn read_map_elt_val<T, F>(&mut self, f: F) -> T
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user