lrbalt / libsoxr-rs

Rust wrapper for libsoxr (resampling library for sounds)
Other
8 stars 2 forks source link

Re-export Error and Result types #3

Closed OrionNebula closed 3 years ago

OrionNebula commented 3 years ago

Rust normally prevents you from defining a public function with a signature involving a private type. However, due to a bug, Rust only checks for a type's pub modifier rather than ensuring it's exported from the crate (see here). This PR properly re-exports the Error and Result types so that errors can be properly handled by users of libsoxr-rs.

Given that the error type will now be public, I switched to using named public fields inside the Error struct and added some doc comments.

lrbalt commented 3 years ago

Sorry, I did not see this PR before releasing 0.2.1. I did re-export the Error type, but without naming the members. Hope this works for you too