Comparing enums generated from Prisma enums is currently a bit annoying since you can't compare them directly with ==, and matching them indents your code more.
I feel like they should derive PartialEq and Eq.
enum Stuff {
ONE
TWO
THREE
}
if thing == Stuff::One /* binary operation `==` cannot be applied to type `prisma::Thing` */ {
// ...
}
Without it, the workaround is to use match or convert the values to a string with .to_string() and compare that.
Comparing enums generated from Prisma enums is currently a bit annoying since you can't compare them directly with
==
, andmatch
ing them indents your code more. I feel like they should derivePartialEq
andEq
.Without it, the workaround is to use
match
or convert the values to a string with.to_string()
and compare that.