diff options
| author | alexmoon <[email protected]> | 2022-03-27 17:12:57 -0400 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-04-06 05:38:11 +0200 |
| commit | 52c622b1cd02ba13accc84cd57e90b04797f0405 (patch) | |
| tree | 67057b66716715a75a2ca60ecf6115720d577961 /embassy-usb/src/builder.rs | |
| parent | bdc6e0481c42d20d5cca19dfc8ec56306e47296e (diff) | |
Use trait objects instead of generics for UsbDevice::classes
Diffstat (limited to 'embassy-usb/src/builder.rs')
| -rw-r--r-- | embassy-usb/src/builder.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/embassy-usb/src/builder.rs b/embassy-usb/src/builder.rs index f0f94b932..bcb838ff5 100644 --- a/embassy-usb/src/builder.rs +++ b/embassy-usb/src/builder.rs | |||
| @@ -175,10 +175,7 @@ impl<'d, D: Driver<'d>> UsbDeviceBuilder<'d, D> { | |||
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | /// Creates the [`UsbDevice`] instance with the configuration in this builder. | 177 | /// Creates the [`UsbDevice`] instance with the configuration in this builder. |
| 178 | /// | 178 | pub fn build(mut self, classes: &'d mut [&'d mut dyn UsbClass]) -> UsbDevice<'d, D> { |
| 179 | /// If a device has mutliple [`UsbClass`]es, they can be provided as a tuple list: | ||
| 180 | /// `(class1, (class2, (class3, ()))`. | ||
| 181 | pub fn build<C: UsbClass<'d, D>>(mut self, classes: C) -> UsbDevice<'d, D, C> { | ||
| 182 | self.config_descriptor.end_configuration(); | 179 | self.config_descriptor.end_configuration(); |
| 183 | self.bos_descriptor.end_bos(); | 180 | self.bos_descriptor.end_bos(); |
| 184 | 181 | ||
