jflinter / Dwifft

Swift Diff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[RFC] Make `Dwifft` an enum, not a struct

jessesquires opened this issue · comments

It looks like Dwifft is only used as a namespace:
https://github.com/jflinter/Dwifft/blob/master/Dwifft/Dwifft.swift#L79

The problem with a struct is that it can be instantiated, Dwifft(). This isn't a problem now, since there are no instance members, but it is a bit awkward.

Changing this to enum Dwifft (with 0 cases) provides the same effect of namespacing, except you cannot instantiate an enum. 😄

See also: