Closed kstasik-legion closed 3 years ago
Sure I can look into moving this a step further.
What would you suggest doing with all the Result<>
s originating from PsdCursor
- like fn read(&mut self, count: u32) -> Result<&[u8]>
that don't ever return a result?
Should I remove the Result and change it to fn read(&mut self, count: u32) -> &[u8]
or create a CursorError
enum and add variants to all enums that it can be propagated to - such as:
pub enum ImageResourcesDescriptorError {
// ...
ReadError(CursorError)
And for the public API would you prefer to return a Box<Error>
or have a pub enum PsdError {}
returned with concrete variants.
that don't ever return a result?
Ah, I see.
fn read(&mut self, count: u32) -> &[u8]
sounds good for now!
And for the public API would you prefer to return a Box
or have a pub enum PsdError {} returned with concrete variants.
You mean on the Psd
type? Yup a PsdError
sounds great!
Thanks for diving into this!
Related to #9
Thanks!
Thank you!
I'm not sure what is failing on circleci as it asks for too much from me to login but it might be worth looking into running cargo clippy
as part of CI to cleanup a little bit the codebase.
Keep up the good work.
Summary
This PR replaces
failure
crate withthiserror
andanyhow
crates as suggested in failure README.MDProblem
failure
crate is deprecated therefore runningcargo-deny check
projects using cargo-deny reportsunmaintained
.Moreover it reports possible memory safety issues (reports
unsound
).For more info on both issues see https://github.com/rustsec/advisory-db/tree/main/crates/failure.