File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -207,8 +207,8 @@ impl ImagesBuilder {
207207
208208 // upgrades without fails, counts number of flash operations
209209 let total_count = match images. run_basic_upgrade ( permanent) {
210- Ok ( v) => v,
211- Err ( _ ) =>
210+ Some ( v) => v,
211+ None =>
212212 if deps. upgrades . iter ( ) . any ( |u| * u == UpgradeInfo :: Held ) {
213213 0
214214 } else {
@@ -405,16 +405,17 @@ impl Images {
405405 /// A simple upgrade without forced failures.
406406 ///
407407 /// Returns the number of flash operations which can later be used to
408- /// inject failures at chosen steps.
409- pub fn run_basic_upgrade ( & self , permanent : bool ) -> Result < i32 , ( ) > {
408+ /// inject failures at chosen steps. Returns None if it was unable to
409+ /// count the operations in a basic upgrade.
410+ pub fn run_basic_upgrade ( & self , permanent : bool ) -> Option < i32 > {
410411 let ( flash, total_count) = self . try_upgrade ( None , permanent) ;
411412 info ! ( "Total flash operation count={}" , total_count) ;
412413
413414 if !self . verify_images ( & flash, 0 , 1 ) {
414415 warn ! ( "Image mismatch after first boot" ) ;
415- Err ( ( ) )
416+ None
416417 } else {
417- Ok ( total_count)
418+ Some ( total_count)
418419 }
419420 }
420421
You can’t perform that action at this time.
0 commit comments