diff options
author | Alex Crichton <alex@alexcrichton.com> | 2017-01-25 15:37:20 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2017-01-25 16:43:01 -0800 |
commit | 671b1c1d895c54903a10555196b789ebd5ff2c90 (patch) | |
tree | a6a30d529d3d441636df26bbab5e1316df984636 /src/libserialize/collection_impls.rs | |
parent | 1283c029557bcde106adde71f467fe133b3ffeff (diff) | |
download | rust-671b1c1d895c54903a10555196b789ebd5ff2c90.tar.gz |
std: Stabilize APIs for the 1.16.0 release
This commit applies the stabilization/deprecations of the 1.16.0 release, as
tracked by the rust-lang/rust issue tracker and the final-comment-period tag.
The following APIs were stabilized:
* `VecDeque::truncate`
* `VecDeque::resize`
* `String::insert_str`
* `Duration::checked_{add,sub,div,mul}`
* `str::replacen`
* `SocketAddr::is_ipv{4,6}`
* `IpAddr::is_ipv{4,6}`
* `str::repeat`
* `Vec::dedup_by`
* `Vec::dedup_by_key`
* `Result::unwrap_or_default`
* `<*const T>::wrapping_offset`
* `<*mut T>::wrapping_offset`
* `CommandExt::creation_flags` (on Windows)
* `File::set_permissions`
* `String::split_off`
The following APIs were deprecated
* `EnumSet` - replaced with other ecosystem abstractions, long since unstable
Closes #27788
Closes #35553
Closes #35774
Closes #36436
Closes #36949
Closes #37079
Closes #37087
Closes #37516
Closes #37827
Closes #37916
Closes #37966
Closes #38080
Diffstat (limited to 'src/libserialize/collection_impls.rs')
-rw-r--r-- | src/libserialize/collection_impls.rs | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/libserialize/collection_impls.rs b/src/libserialize/collection_impls.rs index ba9bf2b86a6..05cfb6352fb 100644 --- a/src/libserialize/collection_impls.rs +++ b/src/libserialize/collection_impls.rs @@ -11,11 +11,9 @@ //! Implementations of serialization for structures found in libcollections use std::hash::{Hash, BuildHasher}; -use std::mem; use {Decodable, Encodable, Decoder, Encoder}; use std::collections::{LinkedList, VecDeque, BTreeMap, BTreeSet, HashMap, HashSet}; -use collections::enum_set::{EnumSet, CLike}; impl< T: Encodable @@ -128,33 +126,6 @@ impl< } } -impl< - T: Encodable + CLike -> Encodable for EnumSet<T> { - fn encode<S: Encoder>(&self, s: &mut S) -> Result<(), S::Error> { - let mut bits = 0; - for item in self { - bits |= 1 << item.to_usize(); - } - s.emit_usize(bits) - } -} - -impl< - T: Decodable + CLike -> Decodable for EnumSet<T> { - fn decode<D: Decoder>(d: &mut D) -> Result<EnumSet<T>, D::Error> { - let bits = d.read_usize()?; - let mut set = EnumSet::new(); - for bit in 0..(mem::size_of::<usize>()*8) { - if bits & (1 << bit) != 0 { - set.insert(CLike::from_usize(bit)); - } - } - Ok(set) - } -} - impl<K, V, S> Encodable for HashMap<K, V, S> where K: Encodable + Hash + Eq, V: Encodable, |