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

Return Self from Usbd::new #12

Merged
merged 1 commit into from
Sep 27, 2022
Merged

Return Self from Usbd::new #12

merged 1 commit into from
Sep 27, 2022

Conversation

jonas-schievink
Copy link
Contributor

This makes the device_address method usable, and allows adding more methods in the future (although they'll only work before the bus is initialized).

Also build/check the example by default.

cc #8

@jonas-schievink
Copy link
Contributor Author

Looking closer, it looks like you're meant to access the UsbBus implementor (immutably) by calling UsbDevice::bus.

I still think returning Self here makes more sense, as it is much more in line with good API design practices, and we can then add &mut self methods to enforce their use before the USB bus is actually made active.

Hence,
bors r+

@bors
Copy link
Contributor

bors bot commented Sep 27, 2022

Build succeeded:

  • ci

@bors bors bot merged commit 0585ae7 into nrf-rs:main Sep 27, 2022
@jonas-schievink jonas-schievink deleted the return-self branch September 27, 2022 14:15
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.

None yet

1 participant