Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@kurtjd
Copy link

@kurtjd kurtjd commented Oct 17, 2025

This adds a usb feature to Cargo.toml which allows usb-device to be an optional dependency. Components depending on HID over USB functionality (hid.rs and keyboard.rs) are then feature-gated behind this.

USB constructors have been moved to a usb.rs module which is feature-gated as well. To preserve backwards compatibility and not introduce breaking changes, the usb feature is configured as the default and public items from the usb module have been reexported from the crate root.

The motivation for this is I'm using my own HID over i2c backend for example and thus would prefer not to pull in the usb-device dependency into my project, as I need to audit all 3rd-party dependencies. This change would hopefully help any others who find themselves in a similar boat as well.

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