mirror of
https://github.com/serde-rs/serde.git
synced 2025-09-28 13:30:48 +00:00
Relocate cfg attrs out of parse_ip_impl and parse_socket_impl
This commit is contained in:
parent
07e614b52b
commit
26fb134165
@ -1583,6 +1583,7 @@ map_impl! {
|
|||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#[cfg(any(feature = "std", not(no_core_net)))]
|
||||||
macro_rules! parse_ip_impl {
|
macro_rules! parse_ip_impl {
|
||||||
(
|
(
|
||||||
$(#[$attr:meta])*
|
$(#[$attr:meta])*
|
||||||
@ -1735,16 +1736,17 @@ impl<'de> Deserialize<'de> for net::IpAddr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "std", not(no_core_net)))]
|
||||||
parse_ip_impl! {
|
parse_ip_impl! {
|
||||||
#[cfg(any(feature = "std", not(no_core_net)))]
|
|
||||||
net::Ipv4Addr, "IPv4 address", 4
|
net::Ipv4Addr, "IPv4 address", 4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "std", not(no_core_net)))]
|
||||||
parse_ip_impl! {
|
parse_ip_impl! {
|
||||||
#[cfg(any(feature = "std", not(no_core_net)))]
|
|
||||||
net::Ipv6Addr, "IPv6 address", 16
|
net::Ipv6Addr, "IPv6 address", 16
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "std", not(no_core_net)))]
|
||||||
macro_rules! parse_socket_impl {
|
macro_rules! parse_socket_impl {
|
||||||
(
|
(
|
||||||
$(#[$attr:meta])*
|
$(#[$attr:meta])*
|
||||||
@ -1786,14 +1788,14 @@ impl<'de> Deserialize<'de> for net::SocketAddr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "std", not(no_core_net)))]
|
||||||
parse_socket_impl! {
|
parse_socket_impl! {
|
||||||
#[cfg(any(feature = "std", not(no_core_net)))]
|
|
||||||
net::SocketAddrV4, "IPv4 socket address",
|
net::SocketAddrV4, "IPv4 socket address",
|
||||||
|(ip, port)| net::SocketAddrV4::new(ip, port),
|
|(ip, port)| net::SocketAddrV4::new(ip, port),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(any(feature = "std", not(no_core_net)))]
|
||||||
parse_socket_impl! {
|
parse_socket_impl! {
|
||||||
#[cfg(any(feature = "std", not(no_core_net)))]
|
|
||||||
net::SocketAddrV6, "IPv6 socket address",
|
net::SocketAddrV6, "IPv6 socket address",
|
||||||
|(ip, port)| net::SocketAddrV6::new(ip, port, 0, 0),
|
|(ip, port)| net::SocketAddrV6::new(ip, port, 0, 0),
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user