nix icon indicating copy to clipboard operation
nix copied to clipboard

Converts `AddressFamily` to struct with associated consts

Open Jan561 opened this issue 1 year ago • 3 comments
trafficstars

Split off from #2199

Script I used to generate the variants: https://gist.github.com/Jan561/067d64641c93017a9bf6b346ac078ec1

Checklist:

  • [x] I have read CONTRIBUTING.md
  • [x] I have written necessary tests and rustdoc comments
  • [x] A change log has been added if this PR modifies nix's API

Jan561 avatar Nov 25 '23 16:11 Jan561

I'll provide a changelog when rebasing on top of #2211

Jan561 avatar Nov 25 '23 17:11 Jan561

If you want, I can just add the new variants to the enum for the time being, and postpone the breaking changes

Jan561 avatar Nov 30 '23 15:11 Jan561

This is pretty intrusive change. Could you please explain the justification in more detail?

It should've been a struct with associated constants from the beginning.

At least theoretically. I won't ever need vendor address families personally, as well as 99.9% of nix users. So yeah, the practical impact of this PR as is would be very low.

That's why I was suggesting to change the PR to only add new variants to the enum (I only need to change one line of my script).

But before hitting 1.0 (in the very distant future), I would definitely reconsider the current enum API.

Jan561 avatar Dec 04 '23 00:12 Jan561