mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-20 13:51:05 +00:00
Remove RangeInclusive impl for now
The old impl is inconsistent with the new ops::Range impl.
This commit is contained in:
+1
-1
@@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
#![doc(html_root_url="https://docs.serde.rs")]
|
#![doc(html_root_url="https://docs.serde.rs")]
|
||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![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 = "alloc", feature(alloc))]
|
||||||
#![cfg_attr(feature = "collections", feature(collections))]
|
#![cfg_attr(feature = "collections", feature(collections))]
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(linkedlist, type_complexity, doc_markdown))]
|
#![cfg_attr(feature = "cargo-clippy", allow(linkedlist, type_complexity, doc_markdown))]
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ use collections::borrow::ToOwned;
|
|||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use core::hash::{Hash, BuildHasher};
|
use core::hash::{Hash, BuildHasher};
|
||||||
#[cfg(feature = "unstable")]
|
|
||||||
use core::iter;
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
use std::net;
|
use std::net;
|
||||||
#[cfg(any(feature = "std", feature = "unstable"))]
|
#[cfg(any(feature = "std", feature = "unstable"))]
|
||||||
@@ -279,25 +277,6 @@ impl<Idx: Serialize> Serialize for ops::Range<Idx> {
|
|||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#[cfg(feature = "unstable")]
|
|
||||||
impl<A> Serialize for ops::RangeInclusive<A>
|
|
||||||
where ops::RangeInclusive<A>: ExactSizeIterator + iter::Iterator<Item = A> + Clone,
|
|
||||||
A: Serialize
|
|
||||||
{
|
|
||||||
#[inline]
|
|
||||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
|
||||||
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 () {
|
impl Serialize for () {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
|
|||||||
@@ -71,12 +71,11 @@
|
|||||||
//! - VecDeque\<T\>
|
//! - VecDeque\<T\>
|
||||||
//! - Vec\<T\>
|
//! - Vec\<T\>
|
||||||
//! - EnumSet\<T\> (unstable)
|
//! - EnumSet\<T\> (unstable)
|
||||||
//! - Range\<T\> (unstable)
|
|
||||||
//! - RangeInclusive\<T\> (unstable)
|
|
||||||
//! - **Miscellaneous standard library types**:
|
//! - **Miscellaneous standard library types**:
|
||||||
//! - Duration
|
//! - Duration
|
||||||
//! - Path
|
//! - Path
|
||||||
//! - PathBuf
|
//! - PathBuf
|
||||||
|
//! - Range\<T\>
|
||||||
//! - NonZero\<T\> (unstable)
|
//! - NonZero\<T\> (unstable)
|
||||||
//! - **Net types**:
|
//! - **Net types**:
|
||||||
//! - IpAddr
|
//! - IpAddr
|
||||||
|
|||||||
Reference in New Issue
Block a user