jean-airoldie / libzmq-rs

A strict subset of ØMQ with an ergonomic API.
https://jean-airoldie.github.io/libzmq-rs/
Apache License 2.0
58 stars 4 forks source link

Replace failure with thiserror #135

Closed akhilles closed 4 years ago

akhilles commented 4 years ago

failure seems to be deprecated and there are some compelling reasons to use thiserror instead:

I would have opened an issue to discuss this, but I was already using the forked version so decided to just submit a PR.

jean-airoldie commented 4 years ago

I think that's its fine if the Debug implementation of Error does not output the content. So you could add a separate manual implementation such as:

impl fmt::Debug for Error {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        fmt.debug_struct("Error")
           .field("kind", &self.kind)
           .finish()
    }
}

This would allow the T: Debug bound to be removed everywhere.

jean-airoldie commented 4 years ago

Looks good. Can I merge?

akhilles commented 4 years ago

Looks good. Can I merge?

Yup!

jean-airoldie commented 4 years ago

Good stuff! I'll do a release.