iroha
iroha copied to clipboard
Replace `FromVariant` with `derive_more::from`
derive_more::from offers the same functionality as our FromVariant
. Considering that we're making more and more use of the derive_more
we should remove our custom implementation in favor of derive_more
.
TryInto
/TryFrom
can also be derived to go from enum into one of it's variants
We need to make sure that we can cover the functionality already present. Since we already have an implementation, the missing functionality can be merged into derive_more
.
Example: unboxing https://github.com/JelteF/derive_more/issues/153
seems that it's doable with derive_more
. If we find derive_more
to be too verbose, we can make our own macro wrapper which will delegate to derive_more
Currently derive_more
doesn't allow returning custom error types from generated TryInto
impls, and this breaks our EvaluatesTo
type checking. This is going to be fixed in 1.0.0 release, which seems to be happening pretty soon (80% of the milestone completed). So I suggest we revisit this at a later time.