Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InetAddr replacements are not convertible to libstd types? #1710

Closed
khuey opened this issue Apr 28, 2022 · 6 comments · Fixed by #1711
Closed

InetAddr replacements are not convertible to libstd types? #1710

khuey opened this issue Apr 28, 2022 · 6 comments · Fixed by #1711

Comments

@khuey
Copy link
Contributor

khuey commented Apr 28, 2022

Apologies if I've overlooked something here.

The now deprecated nix::sys::socket::InetAddr has a to_std method on it. The replacement Sockaddrin/Sockaddrin6 don't appear to have any equivalent functionality.

@asomers
Copy link
Member

asomers commented Apr 28, 2022

You're right. We could add that back. Or maybe just impl Into<std::net::SocketAddrV4> for SockaddrIn.

@khuey
Copy link
Contributor Author

khuey commented Apr 28, 2022

Yeah the latter was what I was looking for but couldn't find. Would you take a PR?

@asomers
Copy link
Member

asomers commented Apr 28, 2022

sure.

bors bot added a commit that referenced this issue May 3, 2022
1711: Restore conversions from ip v4/6 Sockaddr types to std::net equivalents. r=asomers a=khuey

Fixes #1710

Co-authored-by: Kyle Huey <khuey@kylehuey.com>
@bors bors bot closed this as completed in 024c0d7 May 3, 2022
@rtzoeller
Copy link
Collaborator

@asomers do you view this regression in functionality (prior to this submission) as a bug? Is it worth making a 0.24.2 for this, or just holding out for a future release?

@asomers
Copy link
Member

asomers commented May 4, 2022

No, I don't think of it as a regression. If it were, then we should've named the new methods to_std just like they were in 0.23.0, rather than the more standard into.

@khuey
Copy link
Contributor Author

khuey commented May 4, 2022

The old nix::sys::socket::InetAddr still exists too so its not technically a regression IMO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants