Skip to content

Conversation

delehef
Copy link
Contributor

@delehef delehef commented Dec 17, 2020

Basically a big search & replace to replace snafu-based custom error types to thiserror-based ones, as per #341.

@delehef
Copy link
Contributor Author

delehef commented Dec 17, 2020

So, the new pattern is as follow:

  • each module defines a module::Error type automagically implementing the std::error::Error trait thanks to the thiserror crate ;

  • it may also define a new type module::Result<T> as syntactic sugar for std::result::Result<T, Error> ;

  • potentially fallible functions returns Result<T> instead of T, of which the program using rust-bio can do whatever pleases it.

Does that please everyone? If so, I'll get on replacing the expect there and there with this.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 86.874% when pulling 98bce6f on delehef:thiserror into 480872e on rust-bio:master.

@natir
Copy link
Contributor

natir commented Dec 18, 2020

huge work !

@dlaehnemann dlaehnemann requested a review from tedil December 20, 2020 18:06
Copy link
Member

@tedil tedil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks a lot :)

@tedil tedil merged commit 48665f2 into rust-bio:master Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants