diff options
author | Alex Crichton <alex@alexcrichton.com> | 2015-08-11 17:27:05 -0700 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2015-08-12 14:55:17 -0700 |
commit | 8d90d3f36871a00023cc1f313f91e351c287ca15 (patch) | |
tree | 2d9b616a2468117aa3afe1f6b1f910ff3116776b /src/libserialize/collection_impls.rs | |
parent | d07d465cf60033e35eba16b9e431471d54c712f4 (diff) | |
download | rust-8d90d3f36871a00023cc1f313f91e351c287ca15.tar.gz |
Remove all unstable deprecated functionality
This commit removes all unstable and deprecated functions in the standard
library. A release was recently cut (1.3) which makes this a good time for some
spring cleaning of the deprecated functions.
Diffstat (limited to 'src/libserialize/collection_impls.rs')
-rw-r--r-- | src/libserialize/collection_impls.rs | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/src/libserialize/collection_impls.rs b/src/libserialize/collection_impls.rs index 4b31a606931..cb949940b6d 100644 --- a/src/libserialize/collection_impls.rs +++ b/src/libserialize/collection_impls.rs @@ -8,9 +8,6 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// VecMap -#![allow(deprecated)] - //! Implementations of serialization for structures found in libcollections use std::usize; @@ -19,7 +16,7 @@ use std::hash::Hash; use std::collections::hash_state::HashState; use {Decodable, Encodable, Decoder, Encoder}; -use std::collections::{LinkedList, VecDeque, BTreeMap, BTreeSet, HashMap, HashSet, VecMap}; +use std::collections::{LinkedList, VecDeque, BTreeMap, BTreeSet, HashMap, HashSet}; use collections::enum_set::{EnumSet, CLike}; impl< @@ -228,29 +225,3 @@ impl<T, S> Decodable for HashSet<T, S> }) } } - -impl<V: Encodable> Encodable for VecMap<V> { - fn encode<S: Encoder>(&self, e: &mut S) -> Result<(), S::Error> { - e.emit_map(self.len(), |e| { - for (i, (key, val)) in self.iter().enumerate() { - try!(e.emit_map_elt_key(i, |e| key.encode(e))); - try!(e.emit_map_elt_val(i, |e| val.encode(e))); - } - Ok(()) - }) - } -} - -impl<V: Decodable> Decodable for VecMap<V> { - fn decode<D: Decoder>(d: &mut D) -> Result<VecMap<V>, D::Error> { - d.read_map(|d, len| { - let mut map = VecMap::new(); - for i in 0..len { - let key = try!(d.read_map_elt_key(i, |d| Decodable::decode(d))); - let val = try!(d.read_map_elt_val(i, |d| Decodable::decode(d))); - map.insert(key, val); - } - Ok(map) - }) - } -} |