@@ -313,17 +313,20 @@ impl RecoveryIterator<StepType, StepTypeIter> for AppSubnetRecovery {
313313 wait_for_confirmation ( & self . logger ) ;
314314 }
315315
316- StepType :: DownloadConsensusPool if self . params . download_pool_node . is_none ( ) => {
317- // We could pick a node with highest finalization and CUP height automatically,
318- // but we might have a preference between nodes of same heights.
319- print_height_info (
320- & self . logger ,
321- & self . recovery . registry_helper ,
322- self . params . subnet_id ,
323- ) ;
316+ #[ allow( clippy:: collapsible_match) ]
317+ StepType :: DownloadConsensusPool => {
318+ if self . params . download_pool_node . is_none ( ) {
319+ // We could pick a node with highest finalization and CUP height automatically,
320+ // but we might have a preference between nodes of same heights.
321+ print_height_info (
322+ & self . logger ,
323+ & self . recovery . registry_helper ,
324+ self . params . subnet_id ,
325+ ) ;
324326
325- self . params . download_pool_node =
326- Some ( read ( & self . logger , "Enter consensus pool download IP:" ) ) ;
327+ self . params . download_pool_node =
328+ Some ( read ( & self . logger , "Enter consensus pool download IP:" ) ) ;
329+ }
327330 }
328331
329332 StepType :: DownloadState => {
@@ -352,21 +355,30 @@ impl RecoveryIterator<StepType, StepTypeIter> for AppSubnetRecovery {
352355 }
353356 }
354357
355- StepType :: ICReplay if self . params . replay_until_height . is_none ( ) => {
356- self . params . replay_until_height =
357- read_optional ( & self . logger , "Replay until height: " ) ;
358+ #[ allow( clippy:: collapsible_match) ]
359+ StepType :: ICReplay => {
360+ if self . params . replay_until_height . is_none ( ) {
361+ self . params . replay_until_height =
362+ read_optional ( & self . logger , "Replay until height: " ) ;
363+ }
358364 }
359365
360- StepType :: ElectVersion if self . params . upgrade_version . is_none ( ) => {
361- self . params . upgrade_version =
362- read_optional ( & self . logger , "Version to bless (and upgrade to): " ) ;
366+ #[ allow( clippy:: collapsible_match) ]
367+ StepType :: ElectVersion => {
368+ if self . params . upgrade_version . is_none ( ) {
369+ self . params . upgrade_version =
370+ read_optional ( & self . logger , "Version to bless (and upgrade to): " ) ;
371+ }
363372 }
364373
365- StepType :: UpgradeVersion if self . params . upgrade_version . is_none ( ) => {
366- self . params . upgrade_version = read_optional (
367- & self . logger ,
368- "Version to upgrade to (WARN: it should already be blessed): " ,
369- ) ;
374+ #[ allow( clippy:: collapsible_match) ]
375+ StepType :: UpgradeVersion => {
376+ if self . params . upgrade_version . is_none ( ) {
377+ self . params . upgrade_version = read_optional (
378+ & self . logger ,
379+ "Version to upgrade to (WARN: it should already be blessed): " ,
380+ ) ;
381+ }
370382 }
371383
372384 StepType :: ProposeCup => {
@@ -390,21 +402,27 @@ impl RecoveryIterator<StepType, StepTypeIter> for AppSubnetRecovery {
390402 }
391403 }
392404
393- StepType :: UploadState if self . params . upload_method . is_none ( ) => {
394- self . params . upload_method = Some ( read_data_location (
395- & self . logger ,
396- "Are you performing a local recovery directly on the node, or a remote recovery? [local/<ipv6>]" ,
397- ) ) ;
405+ #[ allow( clippy:: collapsible_match) ]
406+ StepType :: UploadState => {
407+ if self . params . upload_method . is_none ( ) {
408+ self . params . upload_method = Some ( read_data_location (
409+ & self . logger ,
410+ "Are you performing a local recovery directly on the node, or a remote recovery? [local/<ipv6>]" ,
411+ ) ) ;
412+ }
398413 }
399414
400- StepType :: WaitForCUP if self . params . wait_for_cup_node . is_none ( ) => {
401- if let Some ( DataLocation :: Remote ( ip) ) = self . params . upload_method {
402- self . params . wait_for_cup_node = Some ( ip) ;
403- } else {
404- self . params . wait_for_cup_node = read_optional (
405- & self . logger ,
406- "Enter IP of the node to be polled for the recovery CUP:" ,
407- ) ;
415+ #[ allow( clippy:: collapsible_match) ]
416+ StepType :: WaitForCUP => {
417+ if self . params . wait_for_cup_node . is_none ( ) {
418+ if let Some ( DataLocation :: Remote ( ip) ) = self . params . upload_method {
419+ self . params . wait_for_cup_node = Some ( ip) ;
420+ } else {
421+ self . params . wait_for_cup_node = read_optional (
422+ & self . logger ,
423+ "Enter IP of the node to be polled for the recovery CUP:" ,
424+ ) ;
425+ }
408426 }
409427 }
410428
0 commit comments