bczhc / bzip3-rs

Rust wrapper for bzip3 compression library
GNU Lesser General Public License v3.0
1 stars 1 forks source link

API suggestion: Move `Error` to crate root #2

Closed marcospb19 closed 1 year ago

marcospb19 commented 1 year ago

Taking serde_json as an example, it seems good to have Error and Result at the root of your crate so users can refer to it as bzip3::Error and bzip3::Result.

They can be a link to bzip3::error::*, but I don't think it's strictly necessary to have the explicit module exposed in your API.

bczhc commented 1 year ago

OK I've made the changes as you suggested. In my old experience also a number of crates are using crate::errors::{Error, Result} scheme and not exposing them, just like mine. That's right because moving them to crate root can be more practical and easy-to-use.

ff49ca48f43842cf88e4c9bacb29f17613b8d2cf