@@ -128,10 +128,10 @@ impl CheckpointsView {
128128 match state {
129129 State :: V1 { checkpoints } => {
130130 for checkpoint in checkpoints {
131- if let Some ( ignore_before) = ignore_before {
132- if checkpoint. modified < ignore_before {
133- continue ;
134- }
131+ if let Some ( ignore_before) = ignore_before
132+ && checkpoint. modified < ignore_before
133+ {
134+ continue ;
135135 }
136136 self . load ( checkpoint) ;
137137 }
@@ -179,20 +179,18 @@ impl CheckpointsView {
179179 self . update ( fng, pos) ;
180180 }
181181
182- if self . checkpoints . get ( & fng) . is_none ( ) {
183- if let Ok ( Some ( fingerprint) ) =
182+ if self . checkpoints . get ( & fng) . is_none ( )
183+ && let Ok ( Some ( fingerprint) ) =
184184 fingerprinter. get_legacy_checksum ( path, fingerprint_buffer)
185- {
186- if let Some ( ( _, pos) ) = self . checkpoints . remove ( & fingerprint) {
187- self . update ( fng, pos) ;
188- }
185+ {
186+ if let Some ( ( _, pos) ) = self . checkpoints . remove ( & fingerprint) {
187+ self . update ( fng, pos) ;
189188 }
190189 if let Ok ( Some ( fingerprint) ) =
191190 fingerprinter. get_legacy_first_lines_checksum ( path, fingerprint_buffer)
191+ && let Some ( ( _, pos) ) = self . checkpoints . remove ( & fingerprint)
192192 {
193- if let Some ( ( _, pos) ) = self . checkpoints . remove ( & fingerprint) {
194- self . update ( fng, pos) ;
195- }
193+ self . update ( fng, pos) ;
196194 }
197195 }
198196 }
@@ -405,15 +403,15 @@ impl Checkpointer {
405403 fn read_legacy_checkpoints ( & mut self , ignore_before : Option < DateTime < Utc > > ) {
406404 for path in glob ( & self . glob_string ) . unwrap ( ) . flatten ( ) {
407405 let mut mtime = None ;
408- if let Some ( ignore_before) = ignore_before {
409- if let Ok ( Ok ( modified) ) = fs:: metadata ( & path) . map ( |metadata| metadata. modified ( ) ) {
410- let modified = DateTime :: < Utc > :: from ( modified) ;
411- if modified < ignore_before {
412- fs:: remove_file ( path) . ok ( ) ;
413- continue ;
414- }
415- mtime = Some ( modified) ;
406+ if let Some ( ignore_before) = ignore_before
407+ && let Ok ( Ok ( modified) ) = fs:: metadata ( & path) . map ( |metadata| metadata. modified ( ) )
408+ {
409+ let modified = DateTime :: < Utc > :: from ( modified) ;
410+ if modified < ignore_before {
411+ fs:: remove_file ( path) . ok ( ) ;
412+ continue ;
416413 }
414+ mtime = Some ( modified) ;
417415 }
418416 let ( fng, pos) = self . decode ( & path) ;
419417 self . checkpoints . checkpoints . insert ( fng, pos) ;
0 commit comments