flipperzero-rs / flipperzero

Rust on the Flipper Zero
MIT License
518 stars 34 forks source link

Add `sys::furi::Error` type for kernel errors #186

Closed dcoles closed 2 weeks ago

dcoles commented 3 weeks ago

This is an updated attempt at improving the ergonomics around working with FuriStatus. Rather than trying to use sys::furi::Status as a pseudo-Error/Result type, use a dedicated Error enum.

In a future PR I'm going to change how the bindings for enum FuriStatus to a newtype rather than integer constant. This will remove the need for a seperate sys::furi::Status type and the associated hoops required to turn that into a Result type. Being an alias for i32 limits what traits or functions can be implemented on the type.

dcoles commented 3 weeks ago

Follow-up to #183.