From c37fb540ca68a9d403e4fe9dd47c47b7381fe302 Mon Sep 17 00:00:00 2001 From: Bogdan Mircea Date: Tue, 10 Jun 2025 16:04:08 +0300 Subject: [PATCH] fix: impl Sync for UsbBusAllocator --- src/bus.rs | 2 ++ src/lib.rs | 1 + 2 files changed, 3 insertions(+) diff --git a/src/bus.rs b/src/bus.rs index 5c6af03..90bda82 100644 --- a/src/bus.rs +++ b/src/bus.rs @@ -318,6 +318,8 @@ impl UsbBusAllocator { } } +unsafe impl Sync for UsbBusAllocator where T: Sync + UsbBus {} + /// A handle for a USB interface that contains its number. #[derive(Copy, Clone, Eq, PartialEq)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] diff --git a/src/lib.rs b/src/lib.rs index ad009fb..d218c9e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -289,4 +289,5 @@ fn _ensure_sync() { ensure_sync::>(); ensure_sync::>(); ensure_sync::>(); + ensure_sync::>(); }