Skip to content

Conversation

pronebird
Copy link
Contributor

What does this PR do

At the moment nix only offers conversions between SockaddrIn -> SocketAddrV4 and SockaddrIn6 -> SocketAddrV6 but no conversions to the container type, SocketAddr itself.

While it's trivial to wrap either SocketAddrV4 or SocketAddrV6 into SocketAddr, I think having a shortcut would improve ergonomics and essentially align nix with std, which supports From conversions from SocketAddrV{4,6} to SocketAddr.

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API
Copy link
Member

@SteveLauC SteveLauC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@SteveLauC SteveLauC added this pull request to the merge queue Aug 23, 2024
Merged via the queue into nix-rust:master with commit 43b7a74 Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants