ralexstokes / ssz-rs

Implementation of ethereum's `ssz`
Apache License 2.0
103 stars 41 forks source link

Allow use of errors in places expecting `E: std::error::Error` #46

Closed ralexstokes closed 1 year ago

ralexstokes commented 1 year ago

something dropped in #25 was impl Error for all the various error types

I think we can just declare an impl for the std context and call it day. Update: this was the route taken.

While working on this a few other updates arrived:

  1. Expose Instance and Type errors to simplify error UX for consumers
  2. remove the problematic FromIterator impl for List and Vector
  3. update the TryFrom impl for List and Vector so the user can recover their data if they use these methods and they fail
  4. add Default impls that use the TryFrom impl