I'm spending some time poking around and thought I'd submit a few PRs for bits and pieces.
This PR refactors the top-level Error enum so that it's an opaque struct instead of an open enum. This means changes can be made to the internals of the error without breaking callers relying on the enum having a particular shape. As an example of a change, one day we might want to replace the Lib(String) variant with something strongly typed. It also means a Backtrace could be introduced, because it'll have a natural place to live within the struct.
Hi! :wave:
I'm spending some time poking around and thought I'd submit a few PRs for bits and pieces.
This PR refactors the top-level
Error
enum so that it's an opaque struct instead of an openenum
. This means changes can be made to the internals of the error without breaking callers relying on the enum having a particular shape. As an example of a change, one day we might want to replace theLib(String)
variant with something strongly typed. It also means aBacktrace
could be introduced, because it'll have a natural place to live within the struct.