Skip to content

Commit

Permalink
Reformat parse_ip_impl definition and calls
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Sep 6, 2024
1 parent 4c0dd63 commit d549f04
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions serde/src/de/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1585,9 +1585,7 @@ map_impl! {

#[cfg(any(feature = "std", not(no_core_net)))]
macro_rules! parse_ip_impl {
(
$ty:ty, $expecting:expr, $size:tt
) => {
($ty:ty, $expecting:expr, $size:tt) => {
impl<'de> Deserialize<'de> for $ty {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
Expand Down Expand Up @@ -1735,14 +1733,10 @@ impl<'de> Deserialize<'de> for net::IpAddr {
}

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

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

#[cfg(any(feature = "std", not(no_core_net)))]
macro_rules! parse_socket_impl {
Expand Down

0 comments on commit d549f04

Please sign in to comment.