|
|
|
|
|
by steveklabnik
16 days ago
|
|
Rust makes you define an enum of E, F, and G, but also provides a conversion API so you can pass any of the three and it feels like it does, at least at the site of returning the error. It also provides an error interface so sometimes you don’t need the enum, if all the types return that interface. |
|
i.e. as types you don't know about get introduced the compiler won't stop bad things from happening: