-
Notifications
You must be signed in to change notification settings - Fork 232
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
372: Implement Eq
and Hash
for socket2::SockAddr
#374
Conversation
Benchmarks https://github.com/lshlyapnikov/socket2/blob/sockaddr-quickcheck/benches/sockaddr_bench.rs
I will keep these benchmarks in my fork. Let me know when/if you want to add them to the |
Looks pretty decent.
I think that's ok for now. If we ever get a complaint about the performance we can add them. Thanks for the pr. |
Closes: #372.
This PR started as: #373, which was based off of
v0.4.x
by mistake, changing the base tomaster
.Cannot derive
Eq
andHash
forsocket2::SockAddr
becausesockaddr_storage
does not have both traits derived/implemented.sockaddr_storage
is defined withins_no_extra_traits
, my assumption it is expected to stay this way and I should not derive/implementEq
andHash
forsockaddr_storage
.TODO:
socket2::SockAddr::as_socket
+std::net::SocketAddr::hash
vssocket2::SockAddr::hash
(this implementation). Benchmarks are not part of this PR, can be found here: https://github.com/lshlyapnikov/socket2/blob/sockaddr-quickcheck/benches/sockaddr_bench.rs