File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -413,10 +413,10 @@ where
413
413
// ...parse and apply the updates with an id higher than the monitor.
414
414
let mut current_update_id = monitor. get_latest_update_id ( ) ;
415
415
loop {
416
- current_update_id = match current_update_id. checked_add ( 1 ) {
417
- Some ( next_update_id ) => next_update_id ,
418
- None => break ,
419
- } ;
416
+ current_update_id = current_update_id. checked_add ( 1 ) . ok_or ( io :: Error :: new (
417
+ io :: ErrorKind :: Other ,
418
+ "invalid update found at u64::MAX" ,
419
+ ) ) ? ;
420
420
let update_name = UpdateName :: from ( current_update_id) ;
421
421
let update = match self . read_monitor_update ( & monitor_name, & update_name) {
422
422
Ok ( update) => update,
@@ -619,7 +619,7 @@ where
619
619
let mut end = monitor. get_latest_update_id ( ) ;
620
620
// Typically, we'll clean up between the last two known full monitors. We
621
621
// shouldn't bother cleaning up if the update_id difference is less than or
622
- // equal to one, since that implies no updates would be there.
622
+ // equal to one, since that implies no updates would be there.
623
623
if end - start > 1 {
624
624
if monitor. get_latest_update_id ( ) == CLOSED_CHANNEL_UPDATE_ID {
625
625
// We don't want to clean the rest of u64, so just do possible pending updates
You can’t perform that action at this time.
0 commit comments