diff options
Diffstat (limited to 'samples/rust/rust_driver_usb.rs')
| -rw-r--r-- | samples/rust/rust_driver_usb.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/samples/rust/rust_driver_usb.rs b/samples/rust/rust_driver_usb.rs index ab72e99e1274..02bd5085f9bc 100644 --- a/samples/rust/rust_driver_usb.rs +++ b/samples/rust/rust_driver_usb.rs @@ -26,21 +26,22 @@ kernel::usb_device_table!( impl usb::Driver for SampleDriver { type IdInfo = (); + type Data<'bound> = Self; const ID_TABLE: usb::IdTable<Self::IdInfo> = &USB_TABLE; - fn probe( - intf: &usb::Interface<Core>, + fn probe<'bound>( + intf: &'bound usb::Interface<Core<'_>>, _id: &usb::DeviceId, - _info: &Self::IdInfo, - ) -> impl PinInit<Self, Error> { - let dev: &device::Device<Core> = intf.as_ref(); + _info: &'bound Self::IdInfo, + ) -> impl PinInit<Self, Error> + 'bound { + let dev: &device::Device<Core<'_>> = intf.as_ref(); dev_info!(dev, "Rust USB driver sample probed\n"); Ok(Self { _intf: intf.into() }) } - fn disconnect(intf: &usb::Interface<Core>, _data: Pin<&Self>) { - let dev: &device::Device<Core> = intf.as_ref(); + fn disconnect<'bound>(intf: &'bound usb::Interface<Core<'_>>, _data: Pin<&Self>) { + let dev: &device::Device<Core<'_>> = intf.as_ref(); dev_info!(dev, "Rust USB driver sample disconnected\n"); } } |
