Skip to content

Consider removing From<IpXXAddr> for IpXXNetwork #190

Description

@sunshowers

Hi there, thanks for maintaining this crate!

At our workplace we ran into an issue where we were accidentally converting an Ipv6Addr to an Ipv6Network. The conversion seems a bit risky because an address and a network represent different things.

In contrast, From<Ipv4Network> for IpNetwork and From<Ipv6Network> for IpNetwork are reasonable to have.

Would you consider removing these impls and maybe introducing single constructors to represent the single IP use case? That would have made this bug much easier to spot.

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions