@@ -299,7 +299,7 @@ impl Manager {
299299 let path = device. keys ( ) . next ( ) . cloned ( ) ;
300300 let response = match path {
301301 Some ( path) => Ok ( path) ,
302- None => Err ( ManagerError :: CreateTargetDeviceFailed (
302+ _ => Err ( ManagerError :: CreateTargetDeviceFailed (
303303 "Unable to find device path" . to_string ( ) ,
304304 ) ) ,
305305 } ;
@@ -860,7 +860,7 @@ impl Manager {
860860 let tx = self . tx . clone ( ) ;
861861 let task = tokio:: spawn ( async move {
862862 if let Err ( e) = device. run ( ) . await {
863- log:: error!( "Error running {composite_path}: {}" , e . to_string ( ) ) ;
863+ log:: error!( "Error running {composite_path}: {e}" ) ;
864864 }
865865 log:: debug!( "Composite device stopped running: {composite_path}" ) ;
866866 if let Err ( e) = tx
@@ -870,8 +870,7 @@ impl Manager {
870870 . await
871871 {
872872 log:: error!(
873- "Error sending to composite device {composite_path} the stopped signal: {}" ,
874- e. to_string( )
873+ "Error sending to composite device {composite_path} the stopped signal: {e}"
875874 ) ;
876875 }
877876 } ) ;
@@ -1009,7 +1008,7 @@ impl Manager {
10091008 }
10101009
10111010 // Check if the composite device has to be unique (default to being unique)
1012- if source_device. unique . map_or_else ( || true , |unique| unique ) {
1011+ if source_device. unique . unwrap_or ( true ) {
10131012 log:: trace!(
10141013 "Found unique device {:?}, not adding to composite device {composite_device}" ,
10151014 source_device
@@ -1659,15 +1658,16 @@ impl Manager {
16591658 // Try to load the composite device profile
16601659 log:: trace!( "Found file: {}" , file. display( ) ) ;
16611660 let device = CompositeDeviceConfig :: from_yaml_file ( file. display ( ) . to_string ( ) ) ;
1662- if device. is_err ( ) {
1663- log:: warn!(
1664- "Failed to parse composite device config '{}': {}" ,
1665- file. display( ) ,
1666- device. unwrap_err( )
1667- ) ;
1668- continue ;
1669- }
1670- let device = device. unwrap ( ) ;
1661+ let device = match device {
1662+ Ok ( dev) => dev,
1663+ Err ( e) => {
1664+ log:: warn!(
1665+ "Failed to parse composite device config '{}': {e}" ,
1666+ file. display( )
1667+ ) ;
1668+ continue ;
1669+ }
1670+ } ;
16711671 devices. push ( ( file, device) ) ;
16721672 }
16731673
0 commit comments