sinshu / rustysynth

A SoundFont MIDI synthesizer written in pure Rust
Other
108 stars 20 forks source link

Use more informative error types #3

Closed lunabunn closed 1 year ago

lunabunn commented 1 year ago

It would be much easier for downstream crates to handle errors if they were returned as enums rather than String errors in the form Box<dyn Error>. Not only are the current errors impossible to match on, they are also incompatible with error handling solutions such as anyhow.

If this change would be welcome, I would be willing to PR it?

sinshu commented 1 year ago

Since I'm still new to Rust, PRs to make the code more idiomatic are welcome 😄

sinshu commented 1 year ago

I tried adding error types: #7 However, I'm not sure if this is natural from the perspective of Rust's conventions.

sinshu commented 1 year ago

I've reviewed some error-related docs, and it seems fine, so I'll merge it and close this issue.