Skip to content

Commit

Permalink
Delete doc(cfg) attribute from impls that are supported in no-std
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 6, 2024
1 parent b4f860e commit b1f899f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
6 changes: 0 additions & 6 deletions serde/src/de/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1717,7 +1717,6 @@ macro_rules! deserialize_enum {
}

#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
impl<'de> Deserialize<'de> for net::IpAddr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand All @@ -1738,13 +1737,11 @@ impl<'de> Deserialize<'de> for net::IpAddr {

parse_ip_impl! {
#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
net::Ipv4Addr, "IPv4 address", 4
}

parse_ip_impl! {
#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
net::Ipv6Addr, "IPv6 address", 16
}

Expand All @@ -1771,7 +1768,6 @@ macro_rules! parse_socket_impl {
}

#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
impl<'de> Deserialize<'de> for net::SocketAddr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand All @@ -1792,14 +1788,12 @@ impl<'de> Deserialize<'de> for net::SocketAddr {

parse_socket_impl! {
#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
net::SocketAddrV4, "IPv4 socket address",
|(ip, port)| net::SocketAddrV4::new(ip, port),
}

parse_socket_impl! {
#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
net::SocketAddrV6, "IPv6 socket address",
|(ip, port)| net::SocketAddrV6::new(ip, port, 0, 0),
}
Expand Down
6 changes: 0 additions & 6 deletions serde/src/ser/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,6 @@ macro_rules! serialize_display_bounded_length {
}

#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
impl Serialize for net::IpAddr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down Expand Up @@ -855,7 +854,6 @@ fn test_format_u8() {
}

#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
impl Serialize for net::Ipv4Addr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand All @@ -880,7 +878,6 @@ impl Serialize for net::Ipv4Addr {
}

#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
impl Serialize for net::Ipv6Addr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand All @@ -897,7 +894,6 @@ impl Serialize for net::Ipv6Addr {
}

#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
impl Serialize for net::SocketAddr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand All @@ -922,7 +918,6 @@ impl Serialize for net::SocketAddr {
}

#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
impl Serialize for net::SocketAddrV4 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand All @@ -939,7 +934,6 @@ impl Serialize for net::SocketAddrV4 {
}

#[cfg(any(feature = "std", not(no_core_net)))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "std", not(no_core_net)))))]
impl Serialize for net::SocketAddrV6 {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
Expand Down

0 comments on commit b1f899f

Please sign in to comment.