@@ -265,7 +265,7 @@ pub async fn reap_containers(
265265 // reason, the returned creation time is missing or negative, skip the container.
266266 let Some ( creation_secs) = container. created else {
267267 warn ! ( "Skipped container {}: missing creation timestamp" , id) ;
268- return false
268+ return false ;
269269 } ;
270270 let creation_secs: u64 = match creation_secs. try_into ( ) {
271271 Ok ( secs) => secs,
@@ -275,8 +275,11 @@ pub async fn reap_containers(
275275 }
276276 } ;
277277 let Some ( age) = now. checked_sub ( Duration :: from_secs ( creation_secs) ) else {
278- warn ! ( "Skipped container {}: creation timestamp after system time" , id) ;
279- return false
278+ warn ! (
279+ "Skipped container {}: creation timestamp after system time" ,
280+ id
281+ ) ;
282+ return false ;
280283 } ;
281284 let within_age_range = age > config. min_age . unwrap_or ( Duration :: ZERO )
282285 && age < config. max_age . unwrap_or ( Duration :: MAX ) ;
@@ -292,7 +295,7 @@ pub async fn reap_containers(
292295 for container in eligible_containers {
293296 let Some ( id) = container. id else {
294297 warn ! ( "Skipped container (unknown ID): missing ID value" ) ;
295- continue
298+ continue ;
296299 } ;
297300 eligible_resources. push ( Resource {
298301 resource_type : ResourceType :: Container ,
@@ -368,19 +371,25 @@ pub async fn reap_networks(
368371 eligible_networks. retain ( |network| {
369372 let Some ( ref name) = network. name else {
370373 warn ! ( "Skipped network (unknown name): missing name value" ) ;
371- return false
374+ return false ;
372375 } ;
373376 let Some ( ref creation_timestamp) = network. created else {
374377 warn ! ( "Skipped network {}: missing creation timestamp" , name) ;
375- return false
378+ return false ;
376379 } ;
377380 let Ok ( creation_time) = chrono:: DateTime :: parse_from_rfc3339 ( creation_timestamp) else {
378- warn ! ( "Skipped network {}: failed to parse creation timestamp as RFC3339" , name) ;
379- return false
381+ warn ! (
382+ "Skipped network {}: failed to parse creation timestamp as RFC3339" ,
383+ name
384+ ) ;
385+ return false ;
380386 } ;
381387 let Ok ( age) = now. signed_duration_since ( creation_time) . to_std ( ) else {
382- warn ! ( "Skipped network {}: creation timestamp after system time" , name) ;
383- return false
388+ warn ! (
389+ "Skipped network {}: creation timestamp after system time" ,
390+ name
391+ ) ;
392+ return false ;
384393 } ;
385394 let within_age_range = age > config. min_age . unwrap_or ( Duration :: ZERO )
386395 && age < config. max_age . unwrap_or ( Duration :: MAX ) ;
@@ -394,9 +403,9 @@ pub async fn reap_networks(
394403 . into_iter ( )
395404 . filter_map ( |network| {
396405 let Some ( name) = network. name else {
397- warn ! ( "Skipped network (unknown name): missing name value" ) ;
398- return None
399- } ;
406+ warn ! ( "Skipped network (unknown name): missing name value" ) ;
407+ return None ;
408+ } ;
400409 Some ( Resource {
401410 resource_type : ResourceType :: Network ,
402411 id : name. clone ( ) ,
@@ -447,20 +456,29 @@ pub async fn reap_volumes(
447456 eligible_volumes. retain ( |volume| {
448457 let Some ( ref creation_timestamp) = volume. created_at else {
449458 warn ! ( "Skipped volume {}: missing creation timestamp" , volume. name) ;
450- return false
459+ return false ;
451460 } ;
452461 let Ok ( creation_time) = chrono:: DateTime :: parse_from_rfc3339 ( creation_timestamp) else {
453- warn ! ( "Skipped volume {}: failed to parse creation timestamp as RFC3339" , volume. name) ;
454- return false
462+ warn ! (
463+ "Skipped volume {}: failed to parse creation timestamp as RFC3339" ,
464+ volume. name
465+ ) ;
466+ return false ;
455467 } ;
456468 let Ok ( age) = now. signed_duration_since ( creation_time) . to_std ( ) else {
457- warn ! ( "Skipped volume {}: creation timestamp after system time" , volume. name) ;
458- return false
469+ warn ! (
470+ "Skipped volume {}: creation timestamp after system time" ,
471+ volume. name
472+ ) ;
473+ return false ;
459474 } ;
460475 let within_age_range = age > config. min_age . unwrap_or ( Duration :: ZERO )
461476 && age < config. max_age . unwrap_or ( Duration :: MAX ) ;
462477 if !within_age_range {
463- debug ! ( "Skipped volume {}: age outside of specified range" , volume. name) ;
478+ debug ! (
479+ "Skipped volume {}: age outside of specified range" ,
480+ volume. name
481+ ) ;
464482 }
465483 within_age_range
466484 } )
0 commit comments