From 150dc198b2010a9b217eaf824b37f50dcfa3efbe Mon Sep 17 00:00:00 2001 From: Kyle Machulis Date: Mon, 1 Jan 2024 09:44:50 -0800 Subject: [PATCH] chore: Move guard acquisition inside logic check --- src/winrtble/peripheral.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/winrtble/peripheral.rs b/src/winrtble/peripheral.rs index b57be8f3..1fbc0714 100644 --- a/src/winrtble/peripheral.rs +++ b/src/winrtble/peripheral.rs @@ -146,9 +146,8 @@ impl Peripheral { } } if let Ok(manufacturer_data) = advertisement.ManufacturerData() { - let mut manufacturer_data_guard = self.shared.latest_manufacturer_data.write().unwrap(); - if manufacturer_data.Size().unwrap() > 0 { + let mut manufacturer_data_guard = self.shared.latest_manufacturer_data.write().unwrap(); *manufacturer_data_guard = manufacturer_data .into_iter() .map(|d| {