@@ -5,7 +5,7 @@ use std::{
55 time:: Duration ,
66} ;
77
8- use anyhow:: { anyhow , Context , Result } ;
8+ use anyhow:: { Context , Result , anyhow } ;
99use futures:: StreamExt as _;
1010use onvif:: soap:: client:: Credentials ;
1111use serde:: Serialize ;
@@ -205,7 +205,9 @@ impl Manager {
205205 Ok :: < ( ) , onvif:: discovery:: Error > ( ( ) ) // Indicate success (discovery part)
206206 }
207207 Err ( error) => {
208- warn ! ( "Task failed: ONVIF discovery failed on interface IP '{ip_addr}': {error:?}" ) ;
208+ warn ! (
209+ "Task failed: ONVIF discovery failed on interface IP '{ip_addr}': {error:?}"
210+ ) ;
209211 Err ( error)
210212 }
211213 }
@@ -222,15 +224,21 @@ impl Manager {
222224 for ( iface_name, ip_addr, task_handle) in discovery_tasks {
223225 match task_handle. await {
224226 Ok ( Ok ( ( ) ) ) => {
225- trace ! ( "Discovery task for interface '{iface_name}' (IP: {ip_addr}) completed successfully." ) ;
227+ trace ! (
228+ "Discovery task for interface '{iface_name}' (IP: {ip_addr}) completed successfully."
229+ ) ;
226230 }
227231 Ok ( Err ( discovery_error) ) => {
228232 // The task ran, but the discovery itself failed
229- warn ! ( "Discovery task for interface '{iface_name}' (IP: {ip_addr}) reported failure: {discovery_error:?}" ) ;
233+ warn ! (
234+ "Discovery task for interface '{iface_name}' (IP: {ip_addr}) reported failure: {discovery_error:?}"
235+ ) ;
230236 }
231237 Err ( join_error) => {
232238 // The task itself panicked or was cancelled
233- error ! ( "Discovery task for interface '{iface_name}' (IP: {ip_addr}) panicked or was cancelled: {join_error:?}" ) ;
239+ error ! (
240+ "Discovery task for interface '{iface_name}' (IP: {ip_addr}) panicked or was cancelled: {join_error:?}"
241+ ) ;
234242 }
235243 }
236244 }
@@ -278,9 +286,7 @@ impl Manager {
278286 let ip_addr = IpAddr :: V4 ( ipv4_network. ip ( ) ) ;
279287 trace ! (
280288 "Found suitable IPv4 address on interface '{}': {} (Subnet: {})" ,
281- interface. name,
282- ip_addr,
283- ipv4_network
289+ interface. name, ip_addr, ipv4_network
284290 ) ;
285291 // Return Some tuple, which will be collected and deduplicated by the HashSet
286292 Some ( ( interface. name . clone ( ) , ip_addr) )
@@ -448,7 +454,10 @@ impl Manager {
448454 trace ! ( "Device credentials lookup result for UUID={device_uuid:?}: {credentials:?}" ) ;
449455
450456 // Iterate through the device's URLs (e.g., different service endpoints)
451- trace ! ( "Attempting to create OnvifCamera instances for device UUID={device_uuid:?}, IP={device_ip}, found {} URL(s)" , device. urls. len( ) ) ;
457+ trace ! (
458+ "Attempting to create OnvifCamera instances for device UUID={device_uuid:?}, IP={device_ip}, found {} URL(s)" ,
459+ device. urls. len( )
460+ ) ;
452461 for ( index, url) in device. urls . iter ( ) . enumerate ( ) {
453462 trace ! (
454463 "Processing URL {}/{} for device UUID={device_uuid:?}: {url}" ,
@@ -486,7 +495,9 @@ impl Manager {
486495 ) ;
487496
488497 let Some ( streams_informations) = streams_information_option else {
489- error ! ( "Failed getting stream information (streams_information is None) for camera created from URL: {url}" ) ;
498+ error ! (
499+ "Failed getting stream information (streams_information is None) for camera created from URL: {url}"
500+ ) ;
490501 continue ; // Move to the next URL
491502 } ;
492503
0 commit comments