diff --git a/host/src/host.rs b/host/src/host.rs index e96fafe..911ca76 100644 --- a/host/src/host.rs +++ b/host/src/host.rs @@ -83,11 +83,6 @@ impl); -} - /// A BLE Host. /// /// The BleHost holds the runtime state of the host, and is the entry point @@ -890,13 +885,10 @@ where + for<'t> ControllerCmdSync> + ControllerCmdSync, { - self.run_with_handler(None).await + self.run_with_handler(|_| {}).await } - pub async fn run_with_handler( - &self, - vendor_handler: Option<&dyn VendorEventHandler>, - ) -> Result<(), BleHostError> + pub async fn run_with_handler(&self, vendor_handler: F) -> Result<(), BleHostError> where T: ControllerCmdSync + ControllerCmdSync @@ -1094,9 +1086,7 @@ where } } Event::Vendor(vendor) => { - if let Some(handler) = vendor_handler { - handler.on_event(&vendor); - } + vendor_handler(&vendor); } // Ignore _ => {}