Delete unuseful RangeFull impls

This commit is contained in:
David Tolnay 2023-07-06 16:10:21 -07:00
parent 0fca04e1a6
commit e6a4a3772e
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 1 additions and 46 deletions

View File

@ -2708,40 +2708,6 @@ mod range_to {
////////////////////////////////////////////////////////////////////////////////
// Similar to:
//
// #[derive(Deserialize)]
// #[serde(deny_unknown_fields)]
// struct RangeFull;
impl<'de> Deserialize<'de> for RangeFull {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
deserializer.deserialize_unit_struct("RangeFull", RangeFullVisitor)
}
}
struct RangeFullVisitor;
impl<'de> Visitor<'de> for RangeFullVisitor {
type Value = RangeFull;
fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
formatter.write_str("unit")
}
#[inline]
fn visit_unit<E>(self) -> Result<Self::Value, E>
where
E: Error,
{
Ok(..)
}
}
////////////////////////////////////////////////////////////////////////////////
#[cfg(any(not(no_ops_bound), all(feature = "std", not(no_collections_bound))))]
impl<'de, T> Deserialize<'de> for Bound<T>
where

View File

@ -180,7 +180,7 @@ mod lib {
pub use self::core::fmt::{self, Debug, Display};
pub use self::core::marker::{self, PhantomData};
pub use self::core::num::Wrapping;
pub use self::core::ops::{Range, RangeFrom, RangeFull, RangeTo};
pub use self::core::ops::{Range, RangeFrom, RangeTo};
pub use self::core::option::{self, Option};
pub use self::core::result::{self, Result};

View File

@ -274,17 +274,6 @@ where
////////////////////////////////////////////////////////////////////////////////
impl Serialize for RangeFull {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
serializer.serialize_unit_struct("RangeFull")
}
}
////////////////////////////////////////////////////////////////////////////////
#[cfg(not(no_range_inclusive))]
impl<Idx> Serialize for RangeInclusive<Idx>
where