Skip to content

Opt out of default features (serde) for ipnetwork#4

Merged
sophacles merged 1 commit intosophacles:mainfrom
faern:disable-ipnetwork-default-features
May 10, 2025
Merged

Opt out of default features (serde) for ipnetwork#4
sophacles merged 1 commit intosophacles:mainfrom
faern:disable-ipnetwork-default-features

Conversation

@faern
Copy link
Copy Markdown
Contributor

@faern faern commented Sep 24, 2024

Thank you for a really nice crate! Being able to create const/static IP types that are properly checked at compile time has been something I have wanted for a long time. This crate solves part of that problem very elegantly ✨

When depending on const-addrs and enabling the ipnet feature, I also get serde as a transitive dependency. None of the code in my dependency tree uses serde for anything. This is just the unfortunate situation we are in with default features in Cargo. I regard them as an antipattern more than anything else.

This PR opts out of any default features in ipnetwork. Currently that's simply the serde functionality being removed.

I have submitted a PR towards ipnetwork to remove serde as a default feature also. So this might be solved in a future release. We can't know yet: achanda/ipnetwork#200

Brings down the transitive dependency tree significantly. This crate
does not use the serialization functionality of ipnetwork anyway!

Default features was a mistake in Cargo :(
@sophacles
Copy link
Copy Markdown
Owner

sophacles commented May 10, 2025

Hello @faern thank you for this PR. I'll merge it now, and cut a release after I also handle #5 .

Apologies for the delay, I missed the notification and just saw this PR when I was making the tickets for #5 and #6 . I'm glad you find the crate useful!

@sophacles sophacles merged commit 9ce5c78 into sophacles:main May 10, 2025
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.

2 participants