Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved panic safety. #156

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Improved panic safety. #156

wants to merge 5 commits into from

Conversation

gtsiam
Copy link

@gtsiam gtsiam commented Jun 9, 2024

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.

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 HidApi::disable_device_discovery() before any HidApi contexts
are created.
Or, in other words: Make clippy happy.
@gtsiam gtsiam marked this pull request as draft June 9, 2024 10:25
@gtsiam gtsiam marked this pull request as ready for review June 9, 2024 10:54
@gtsiam gtsiam changed the title Remove Hidapi::new_without_enumerate(). Improved panic safety. Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant