wisespace-io / binance-rs

Rust Library for the Binance API
Other
665 stars 297 forks source link

errors module should be public to allow for error wrapping #7

Closed monomadic closed 6 years ago

monomadic commented 6 years ago

It is poor practice to expose a private struct as a return for a public interface, especially for errors.

It works only on a technicality, as your examples use a match instead of the more accepted method of deriving a new error type with the From trait. With the library currently there is no way to adopt this trait, making it useless for libraries that wish to adapt and return their own errors, or client code that wishes to make use of the try ? operator.