cogciprocate / ocl

OpenCL for Rust
Other
721 stars 75 forks source link

Avoid direct `Fail` trait implementation #188

Open drahnr opened 4 years ago

drahnr commented 4 years ago

First of all, thank you for this exceptional crate!

I have a usability nitpick though. The error type does not implement the error trait, and hence makes it harder to use than necessary when combined with anyhow or friends, which rely on the fact that trait Error is implemented for automatic conversion.

Now with the trait Fail impl one runs into rustc errors which suggest to add .map_err(|e| e.into())? when using anyhow since the auto conversion fails.

Moving away from failure to i.e. thiserror would simplify error handling or just implementing trait Error from std would also suffice.

I'd be happy to hear your thoughts and if necessary create a PR