ruabmbua / hidapi-rs

Rust bindings for the hidapi C library
MIT License
165 stars 79 forks source link

Improved panic safety. #156

Open gtsiam opened 1 month ago

gtsiam commented 1 month ago

The issue with HidApi::new_without_enumerate() is that it makes both it and HidApi::new() potentially panic, with no way out in library contexts.

Instead, on platforms that need it, the same effect can be achieved by calling the newly added HidApi::disable_device_discovery() before any HidApi contexts are created.