v0.10.0
0.10.0 - 2023-11-10
This release changes IntoVisitor to require that the corresponding Visitor implements scale_decode::Error, rather than allowing the error to be anything that can be converted into a scale_decode::Error. This has the following advantages:
- It makes
DecodeAsTypea proper super-trait ofIntoVisitor, meaning it can be used anywhereIntoVisitoris. Previously, usingDecodeAsTypein some places also required that you add a bound likeB: IntoVisitor, <B::Visitor as Visitor>::Error: Into<scale_decode::Error, ie theErrortype needed to explicitly be declared as convertible in the way thatDecodeAsTyperequires. - It simplifies the code.
- It makes it a bit easier to understand how to correctly make a type implement
DecodeAsType.
The main drawback is that if your Visitor implementation doesn't have Error = scale_decode::Error, then it can no longer be used with IntoVisitor. 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 implements Into<scale_decode::Error> will now implement Visitor with Error = scale_decode::Error.