@@ -315,7 +315,7 @@ async fn repodata_from_file(
315
315
///
316
316
/// The checks to see if a `.zst` and/or `.bz2` file exist are performed by doing a HEAD request to
317
317
/// the respective URLs. The result of these are cached.
318
- #[ instrument( err, skip_all, fields( subdir_url, cache_path = %cache_path. display( ) ) ) ]
318
+ #[ instrument( err, skip_all, fields( subdir_url, cache_path = % cache_path. display( ) ) ) ]
319
319
pub async fn fetch_repo_data (
320
320
subdir_url : Url ,
321
321
client : reqwest_middleware:: ClientWithMiddleware ,
@@ -441,7 +441,7 @@ pub async fn fetch_repo_data(
441
441
has_bz2 : variant_availability. has_bz2 ,
442
442
has_jlap : variant_availability. has_jlap ,
443
443
jlap : Some ( state) ,
444
- .. cache_state. expect ( "we must have had a cache, otherwise we wouldn't know the previous state of the cache" )
444
+ ..cache_state. expect ( "we must have had a cache, otherwise we wouldn't know the previous state of the cache" )
445
445
} ;
446
446
447
447
let cache_state = tokio:: task:: spawn_blocking ( move || {
@@ -528,7 +528,7 @@ pub async fn fetch_repo_data(
528
528
has_bz2 : variant_availability. has_bz2 ,
529
529
has_jlap : variant_availability. has_jlap ,
530
530
jlap : jlap_state,
531
- .. cache_state. expect ( "we must have had a cache, otherwise we wouldn't know the previous state of the cache" )
531
+ ..cache_state. expect ( "we must have had a cache, otherwise we wouldn't know the previous state of the cache" )
532
532
} ;
533
533
534
534
let cache_state = tokio:: task:: spawn_blocking ( move || {
@@ -737,7 +737,7 @@ pub async fn check_variant_availability(
737
737
) -> VariantAvailability {
738
738
// Determine from the cache which variant are available. This is currently cached for a maximum
739
739
// of 14 days.
740
- let expiration_duration = chrono:: Duration :: days ( 14 ) ;
740
+ let expiration_duration = chrono:: TimeDelta :: try_days ( 14 ) . expect ( "14 days is a valid duration" ) ;
741
741
let has_zst = cache_state
742
742
. and_then ( |state| state. has_zst . as_ref ( ) )
743
743
. and_then ( |value| value. value ( expiration_duration) )
0 commit comments