File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ pub const FRAMEWORK13_16_2ND_GEN_PID: u16 = 0x001C;
33pub const FRAMEWORK12_PID : u16 = 0x001D ;
44
55/// Get and print the firmware version of the camera
6- pub fn check_camera_version ( ) {
6+ pub fn check_camera_version ( ) -> Result < ( ) , rusb :: Error > {
77 for dev in rusb:: devices ( ) . unwrap ( ) . iter ( ) {
88 let dev_descriptor = dev. device_descriptor ( ) . unwrap ( ) ;
99 if dev_descriptor. vendor_id ( ) != FRAMEWORK_VID
@@ -19,11 +19,12 @@ pub fn check_camera_version() {
1919 }
2020 let handle = dev. open ( ) . unwrap ( ) ;
2121
22- let dev_descriptor = dev. device_descriptor ( ) . unwrap ( ) ;
22+ let dev_descriptor = dev. device_descriptor ( ) ? ;
2323 let i_product = dev_descriptor
2424 . product_string_index ( )
2525 . and_then ( |x| handle. read_string_descriptor_ascii ( x) . ok ( ) ) ;
2626 println ! ( "{}" , i_product. unwrap_or_default( ) ) ;
2727 println ! ( " Firmware Version: {}" , dev_descriptor. device_version( ) ) ;
2828 }
29+ Ok ( ( ) )
2930}
Original file line number Diff line number Diff line change @@ -473,7 +473,7 @@ fn print_versions(ec: &CrosEc) {
473473 }
474474 }
475475 #[ cfg( feature = "rusb" ) ]
476- check_camera_version ( ) ;
476+ let _ignore_err = check_camera_version ( ) ;
477477}
478478
479479fn print_esrt ( ) {
You can’t perform that action at this time.
0 commit comments