rust-embedded-community / usb-device

Experimental device-side USB framework for microcontrollers in Rust.
MIT License
413 stars 77 forks source link

Replace usage of `expect()` with returning `Result<>` types #113

Closed ryan-summers closed 4 months ago

ryan-summers commented 1 year ago

Currently, there's a number of places where expect() is called on Result<> types. This can introduce format bloat into end-user applications, which may be undesirable.

Instead, we should propagate the Result<> out to the user to allow them to decide what to do with the error.

AlexanderDefuria commented 1 year ago

Has someone started on this?

eldruin commented 1 year ago

Not that I know of. Please feel free to give it a try.

AlexanderDefuria commented 1 year ago

I'll take a stab at this. Thanks!