Open l4l opened 4 years ago
Hmm. What do you think should happen with an empty enum, hard failure? I agree that a warning isn't very helpful.
Well, I actually found it out by an accident, but probably it can be useful with "never" type, e.g. in postgres: CREATE TYPE NeverType AS ENUM ()
. Though, I'm not even sure if it works with diesel properly, but probably might be handy, if so.
Yes, I suppose the easiest thing to do it just remove the match block if there are no variants. No idea if that is really useful to anyone but it would remove the warning.
The following code:
will lead to compiler warning:
Particularly, if expand the macro issue is clearly seen at
ToSql<AMapping, DB>
: