From c488cec6412202280b99748c3a73c480d38aa038 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 13 Mar 2017 11:09:52 -0700 Subject: [PATCH] Remove RangeInclusive impl for now The old impl is inconsistent with the new ops::Range impl. --- serde/src/lib.rs | 2 +- serde/src/ser/impls.rs | 21 --------------------- serde/src/ser/mod.rs | 3 +-- 3 files changed, 2 insertions(+), 24 deletions(-) diff --git a/serde/src/lib.rs b/serde/src/lib.rs index 5c763793..e6a8205f 100644 --- a/serde/src/lib.rs +++ b/serde/src/lib.rs @@ -61,7 +61,7 @@ #![doc(html_root_url="https://docs.serde.rs")] #![cfg_attr(not(feature = "std"), no_std)] -#![cfg_attr(feature = "unstable", feature(inclusive_range, nonzero, specialization, zero_one, into_boxed_c_str))] +#![cfg_attr(feature = "unstable", feature(nonzero, specialization, zero_one, into_boxed_c_str))] #![cfg_attr(feature = "alloc", feature(alloc))] #![cfg_attr(feature = "collections", feature(collections))] #![cfg_attr(feature = "cargo-clippy", allow(linkedlist, type_complexity, doc_markdown))] diff --git a/serde/src/ser/impls.rs b/serde/src/ser/impls.rs index 35f91a63..53ac7bf0 100644 --- a/serde/src/ser/impls.rs +++ b/serde/src/ser/impls.rs @@ -13,8 +13,6 @@ use collections::borrow::ToOwned; #[cfg(feature = "std")] use core::hash::{Hash, BuildHasher}; -#[cfg(feature = "unstable")] -use core::iter; #[cfg(feature = "std")] use std::net; #[cfg(any(feature = "std", feature = "unstable"))] @@ -279,25 +277,6 @@ impl Serialize for ops::Range { /////////////////////////////////////////////////////////////////////////////// -#[cfg(feature = "unstable")] -impl Serialize for ops::RangeInclusive - where ops::RangeInclusive: ExactSizeIterator + iter::Iterator + Clone, - A: Serialize -{ - #[inline] - fn serialize(&self, serializer: S) -> Result - where S: Serializer - { - let mut seq = try!(serializer.serialize_seq(Some(self.len()))); - for e in self.clone() { - try!(seq.serialize_element(&e)); - } - seq.end() - } -} - -/////////////////////////////////////////////////////////////////////////////// - impl Serialize for () { #[inline] fn serialize(&self, serializer: S) -> Result diff --git a/serde/src/ser/mod.rs b/serde/src/ser/mod.rs index edcb69e1..ad03b61f 100644 --- a/serde/src/ser/mod.rs +++ b/serde/src/ser/mod.rs @@ -71,12 +71,11 @@ //! - VecDeque\ //! - Vec\ //! - EnumSet\ (unstable) -//! - Range\ (unstable) -//! - RangeInclusive\ (unstable) //! - **Miscellaneous standard library types**: //! - Duration //! - Path //! - PathBuf +//! - Range\ //! - NonZero\ (unstable) //! - **Net types**: //! - IpAddr