Skip to content

Commit 26fb134

Browse files
committed
Relocate cfg attrs out of parse_ip_impl and parse_socket_impl
1 parent 07e614b commit 26fb134

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

serde/src/de/impls.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,7 @@ map_impl! {
15831583

15841584
////////////////////////////////////////////////////////////////////////////////
15851585

1586+
#[cfg(any(feature = "std", not(no_core_net)))]
15861587
macro_rules! parse_ip_impl {
15871588
(
15881589
$(#[$attr:meta])*
@@ -1735,16 +1736,17 @@ impl<'de> Deserialize<'de> for net::IpAddr {
17351736
}
17361737
}
17371738

1739+
#[cfg(any(feature = "std", not(no_core_net)))]
17381740
parse_ip_impl! {
1739-
#[cfg(any(feature = "std", not(no_core_net)))]
17401741
net::Ipv4Addr, "IPv4 address", 4
17411742
}
17421743

1744+
#[cfg(any(feature = "std", not(no_core_net)))]
17431745
parse_ip_impl! {
1744-
#[cfg(any(feature = "std", not(no_core_net)))]
17451746
net::Ipv6Addr, "IPv6 address", 16
17461747
}
17471748

1749+
#[cfg(any(feature = "std", not(no_core_net)))]
17481750
macro_rules! parse_socket_impl {
17491751
(
17501752
$(#[$attr:meta])*
@@ -1786,14 +1788,14 @@ impl<'de> Deserialize<'de> for net::SocketAddr {
17861788
}
17871789
}
17881790

1791+
#[cfg(any(feature = "std", not(no_core_net)))]
17891792
parse_socket_impl! {
1790-
#[cfg(any(feature = "std", not(no_core_net)))]
17911793
net::SocketAddrV4, "IPv4 socket address",
17921794
|(ip, port)| net::SocketAddrV4::new(ip, port),
17931795
}
17941796

1797+
#[cfg(any(feature = "std", not(no_core_net)))]
17951798
parse_socket_impl! {
1796-
#[cfg(any(feature = "std", not(no_core_net)))]
17971799
net::SocketAddrV6, "IPv6 socket address",
17981800
|(ip, port)| net::SocketAddrV6::new(ip, port, 0, 0),
17991801
}

0 commit comments

Comments
 (0)