Skip to content

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

Merged
thomaseizinger merged 4 commits into
libp2p:masterfrom
umgefahren:remove-lazy-static-from-mdns
Oct 4, 2022
Merged

protocols/mdns: Removed obsolete lazy static use from mdns#2977
thomaseizinger merged 4 commits into
libp2p:masterfrom
umgefahren:remove-lazy-static-from-mdns

Conversation

@umgefahren

@umgefahren umgefahren commented Oct 4, 2022

Copy link
Copy Markdown
Contributor

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

@umgefahren umgefahren left a comment

Copy link
Copy Markdown
Contributor Author

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

@mxinden mxinden left a comment

Copy link
Copy Markdown
Member

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!

@thomaseizinger thomaseizinger left a comment

Copy link
Copy Markdown
Contributor

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