@@ -54,7 +54,7 @@ pub async fn run_bluez_advertisement_listener(
5454
5555 if interface == "org.bluez.Adapter1" {
5656 if let Some ( value) = changed. get( "Discovering" ) {
57- if let Some ( is_discovering) = value. downcast_ref:: <bool >( ) . ok ( ) {
57+ if let Ok ( is_discovering) = value. downcast_ref:: <bool >( ) {
5858 if !is_discovering {
5959 info!( "Discovery was turned off — restarting discovery." ) ;
6060 try_start_discovery( & conn, adapter_index) . await ?;
@@ -71,23 +71,23 @@ pub async fn run_bluez_advertisement_listener(
7171 if let Some ( path) = device_path {
7272 match get_device_properties( & conn, & path) . await {
7373 Ok ( props) => {
74- debug!( "Changed properties for device {}" , path ) ;
74+ debug!( "Changed properties for device {path}" ) ;
7575 if log:: log_enabled!( log:: Level :: Debug ) {
7676 print_props( & props) ;
7777 }
7878 match build_advertisement_response( & props) {
7979 Some ( msg) => {
8080 if let Err ( e) = tx. send( msg) {
81- warn!( "Failed to send advertisement response: {}" , e ) ;
81+ warn!( "Failed to send advertisement response: {e}" ) ;
8282 }
8383 }
8484 None => {
85- warn!( "Failed to build advertisement response for {}" , path ) ;
85+ warn!( "Failed to build advertisement response for {path}" ) ;
8686 }
8787 } ;
8888 }
8989 Err ( e) => {
90- warn!( "Failed to fetch properties for {}: {}" , path , e ) ;
90+ warn!( "Failed to fetch properties for {path }: {e}" ) ;
9191 }
9292 }
9393 }
@@ -102,26 +102,26 @@ pub async fn run_bluez_advertisement_listener(
102102 HashMap <String , HashMap <String , OwnedValue >>
103103 ) = body. deserialize( ) ?;
104104
105- debug!( "InterfacesAdded at path: {}" , path ) ;
105+ debug!( "InterfacesAdded at path: {path}" ) ;
106106 match interfaces. get( "org.bluez.Device1" ) {
107107 Some ( props) => {
108- debug!( "New properties for device {}" , path ) ;
108+ debug!( "New properties for device {path}" ) ;
109109 if log:: log_enabled!( log:: Level :: Debug ) {
110110 print_props( props) ;
111111 }
112- match build_advertisement_response( & props) {
112+ match build_advertisement_response( props) {
113113 Some ( msg) => {
114114 if let Err ( e) = tx. send( msg) {
115- warn!( "Failed to send advertisement response: {}" , e ) ;
115+ warn!( "Failed to send advertisement response: {e}" ) ;
116116 }
117117 }
118118 None => {
119- warn!( "Failed to build advertisement response for {}" , path ) ;
119+ warn!( "Failed to build advertisement response for {path}" ) ;
120120 }
121121 } ;
122122 }
123123 _ => {
124- debug!( "Failed to fetch properties for {}" , path ) ;
124+ debug!( "Failed to fetch properties for {path}" ) ;
125125 }
126126 }
127127 }
@@ -196,12 +196,12 @@ async fn get_device_properties(
196196
197197fn print_props ( props : & HashMap < String , OwnedValue > ) {
198198 for ( key, value) in props {
199- debug ! ( " {} => {:?}" , key , value ) ;
199+ debug ! ( " {key } => {value :?}" ) ;
200200 }
201201}
202202
203203async fn try_start_discovery ( conn : & Connection , adapter_index : u16 ) -> zbus:: Result < ( ) > {
204- let adapter_path = format ! ( "/org/bluez/hci{}" , adapter_index ) ;
204+ let adapter_path = format ! ( "/org/bluez/hci{adapter_index}" ) ;
205205 let proxy = Proxy :: new (
206206 conn,
207207 "org.bluez" ,
0 commit comments