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

protocols/mdns: Removed obsolete lazy static use from mdns #2977

Merged

Conversation

umgefahren
Copy link
Contributor

@umgefahren umgefahren commented Oct 4, 2022

Description

While implementing #2975 I discovered an unnecessary use of lazy_static. It can be replaced with a const, since there is const support for the constructor of Ipv4Addr and Ipv6Addr since Rust version 1.32.0. This also removes an unnecessary dependency and might result in better performance, although very, very marginal.

Links to any relevant issues

None

Open Questions

None.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

Copy link
Contributor Author

@umgefahren umgefahren left a comment

Choose a reason for hiding this comment

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

Seems correct.

@umgefahren umgefahren changed the title Removed obsolete lazy static use from mdns protocols/mdns: Removed obsolete lazy static use from mdns Oct 4, 2022
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Wonderful to see. Thanks for the patch @umgefahren!

Copy link
Contributor

@thomaseizinger thomaseizinger left a comment

Choose a reason for hiding this comment

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

Nice, thanks!

@thomaseizinger thomaseizinger merged commit da0403d into libp2p:master Oct 4, 2022
umgefahren added a commit to umgefahren/rust-libp2p that referenced this pull request Oct 5, 2022
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 this pull request may close these issues.

3 participants