whitequark / rust-xdg

A library that makes it easy to follow the X Desktop Group specifications
https://wiki.freedesktop.org/www/Specifications/
Apache License 2.0
154 stars 30 forks source link

Proposal for error propagation #11

Closed tbu- closed 8 years ago

tbu- commented 8 years ago

This is an attempt to make the library usable in a panic-free way. I'm not too bound to this particular implementation, this is just one possible implementation, however I'd be happy if some form of this would be accepted. This would help addressing the issue for integrating this lib with cargo: https://github.com/rust-lang/cargo/pull/2127#issuecomment-165921905.

Implement error propagation

This allows to let the caller handle errors that occur while determining the XDG paths.

Implement the error as opaque BaseDirectoriesError that implements Debug, Display and Error.

whitequark commented 8 years ago

Otherwise LGTM

tbu- commented 8 years ago

@whitequark Addressed your comment, should I squash the commits?

whitequark commented 8 years ago

It doesn't really matter here.

tbu- commented 8 years ago

Could you make a new pre-release on crates.io with this?

whitequark commented 8 years ago

-pre6

tbu- commented 8 years ago

Thanks!