@@ -17,14 +17,14 @@ use super::{
1717 nsuuid_to_uuid,
1818 } ,
1919} ;
20- use crate :: api:: { CharPropFlags , Characteristic , Descriptor , ScanFilter , Service , WriteType } ;
2120use crate :: Error ;
21+ use crate :: api:: { CharPropFlags , Characteristic , Descriptor , ScanFilter , Service , WriteType } ;
2222use futures:: channel:: mpsc:: { self , Receiver , Sender } ;
2323use futures:: select;
2424use futures:: sink:: SinkExt ;
2525use futures:: stream:: { Fuse , StreamExt } ;
2626use log:: { error, trace, warn} ;
27- use objc2:: { msg_send_id , ClassType } ;
27+ use objc2:: { ClassType , msg_send_id } ;
2828use objc2:: { rc:: Retained , runtime:: AnyObject } ;
2929use objc2_core_bluetooth:: {
3030 CBCentralManager , CBCentralManagerScanOptionAllowDuplicatesKey , CBCharacteristic ,
@@ -566,8 +566,7 @@ impl CoreBluetoothInternal {
566566 ) {
567567 trace ! (
568568 "Got manufacturer data advertisement! {}: {:?}" ,
569- manufacturer_id,
570- manufacturer_data
569+ manufacturer_id, manufacturer_data
571570 ) ;
572571 if let Some ( p) = self . peripherals . get_mut ( & peripheral_uuid) {
573572 if let Err ( e) = p
@@ -703,8 +702,7 @@ impl CoreBluetoothInternal {
703702 ) {
704703 trace ! (
705704 "Found characteristics for peripheral {} service {}:" ,
706- peripheral_uuid,
707- service_uuid
705+ peripheral_uuid, service_uuid
708706 ) ;
709707 for id in characteristics. keys ( ) {
710708 trace ! ( "{}" , id) ;
@@ -723,9 +721,7 @@ impl CoreBluetoothInternal {
723721 ) {
724722 trace ! (
725723 "Found descriptors for peripheral {} service {} characteristic {}:" ,
726- peripheral_uuid,
727- service_uuid,
728- characteristic_uuid,
724+ peripheral_uuid, service_uuid, characteristic_uuid,
729725 ) ;
730726 for id in descriptors. keys ( ) {
731727 trace ! ( "{}" , id) ;
@@ -1048,16 +1044,28 @@ impl CoreBluetoothInternal {
10481044 CBCharacteristicWriteType :: CBCharacteristicWriteWithoutResponse ,
10491045 ) ;
10501046 }
1051- pending. fut . lock ( ) . unwrap ( ) . set_reply ( CoreBluetoothReply :: Ok ) ;
1047+ pending
1048+ . fut
1049+ . lock ( )
1050+ . unwrap ( )
1051+ . set_reply ( CoreBluetoothReply :: Ok ) ;
10521052 } else {
1053- pending. fut . lock ( ) . unwrap ( ) . set_reply ( CoreBluetoothReply :: Err (
1054- "Characteristic no longer available" . into ( ) ,
1055- ) ) ;
1053+ pending
1054+ . fut
1055+ . lock ( )
1056+ . unwrap ( )
1057+ . set_reply ( CoreBluetoothReply :: Err (
1058+ "Characteristic no longer available" . into ( ) ,
1059+ ) ) ;
10561060 }
10571061 } else {
1058- pending. fut . lock ( ) . unwrap ( ) . set_reply ( CoreBluetoothReply :: Err (
1059- "Service no longer available" . into ( ) ,
1060- ) ) ;
1062+ pending
1063+ . fut
1064+ . lock ( )
1065+ . unwrap ( )
1066+ . set_reply ( CoreBluetoothReply :: Err (
1067+ "Service no longer available" . into ( ) ,
1068+ ) ) ;
10611069 }
10621070 }
10631071 }
@@ -1187,11 +1195,7 @@ impl CoreBluetoothInternal {
11871195 }
11881196 }
11891197
1190- fn read_rssi (
1191- & mut self ,
1192- peripheral_uuid : Uuid ,
1193- fut : CoreBluetoothReplyStateShared ,
1194- ) {
1198+ fn read_rssi ( & mut self , peripheral_uuid : Uuid , fut : CoreBluetoothReplyStateShared ) {
11951199 if let Some ( peripheral) = self . peripherals . get_mut ( & peripheral_uuid) {
11961200 trace ! ( "Reading RSSI!" ) ;
11971201 unsafe {
0 commit comments