Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This release changes
IntoVisitor
to require that the correspondingVisitor
implementsscale_decode::Error
, rather than allowing the error to be anything that can be converted into ascale_decode::Error
. This has the following advantages:DecodeAsType
a proper super-trait ofIntoVisitor
, meaning it can be used anywhereIntoVisitor
is. Previously, usingDecodeAsType
in some places also required that you add a bound likeB: IntoVisitor, <B::Visitor as Visitor>::Error: Into<scale_decode::Error
, ie theError
type needed to explicitly be declared as convertible in the way thatDecodeAsType
requires.DecodeAsType
.The main drawback is that if your
Visitor
implementation doesn't haveError = scale_decode::Error
, then it can no longer be used withIntoVisitor
. To work around this, a new adapter type,scale_decode::visitor::VisitorWithCrateError(your_visitor)
has been added; any visitor wrapped in this type whose error implementsInto<scale_decode::Error>
will now implementVisitor
withError = scale_decode::Error
.