Skip to content

Commit

Permalink
Merge pull request #144 from paolobarbolini/collect-str
Browse files Browse the repository at this point in the history
Remove useless allocation when serializing
  • Loading branch information
achanda committed Dec 29, 2021
2 parents 8ad4354 + a57afd9 commit 7120b93
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/ipv4.rs
Expand Up @@ -27,7 +27,7 @@ impl serde::Serialize for Ipv4Network {
where
S: serde::Serializer,
{
serializer.serialize_str(&self.to_string())
serializer.collect_str(self)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ipv6.rs
Expand Up @@ -28,7 +28,7 @@ impl serde::Serialize for Ipv6Network {
where
S: serde::Serializer,
{
serializer.serialize_str(&self.to_string())
serializer.collect_str(self)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Expand Up @@ -46,7 +46,7 @@ impl serde::Serialize for IpNetwork {
where
S: serde::Serializer,
{
serializer.serialize_str(&self.to_string())
serializer.collect_str(self)
}
}

Expand Down

0 comments on commit 7120b93

Please sign in to comment.