You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some solutions:
1 - we make Output returning a result and add the method encode_to_vec in Encode trait so ppl can make use of a trait as an Output without having to call expect on the result.
2 - we generalize first solution by having Output and FailableOutput, and there is two method in Encode which are encode_to, and failable_encode_to (we should come up with better names) and encode_to as default implementation which calls failable_encode_to (because FailableOutput will be implemented for Output) and unwrap the result.
3 - same as 1 but we don't event introduce encode_to_vec, but then all current code that uses this method will have to expect the result with the proof: "Vec implementation of Output never returns error".
In case provided slice is not big enough it should return an error, rather than panic.
The text was updated successfully, but these errors were encountered: