fn check_cache(args: &Args, enable_styles: bool) -> CheckCacheResult {
    match Cache::freshness() {
        CacheFreshness::Fresh => CheckCacheResult::CacheFound,
        CacheFreshness::Stale(_) if args.quiet => CheckCacheResult::CacheFound,
        CacheFreshness::Stale(age) => {
            let warning_style = if enable_styles {
                Style::new().fg(Color::Yellow)
            } else {
                Style::default()
            };
            eprintln!(
                "{}",
                warning_style.paint(format!(
                    "The cache hasn't been updated for {} days.\n\
                     You should probably run `tldr --update` soon.",
                    age.as_secs() / 24 / 3600
                ))
            );
            CheckCacheResult::CacheFound
        }
        CacheFreshness::Missing => {
            eprintln!("Cache not found. Please run `tldr --update`.");
            CheckCacheResult::CacheMissing
        }
    }
}
/// Check the cache for freshness. If it's stale or missing, show a warning.
Check the cache for freshness. If it's stale or missing, show a warning.
Check the cache for freshness . If it ' s stale or missing show a warning .
fn check_cache(args: &Args, enable_styles: bool) -> CheckCacheResult {
    match Cache::freshness() {
        CacheFreshness::Fresh => CheckCacheResult::CacheFound,
        CacheFreshness::Stale(_) if args.quiet => CheckCacheResult::CacheFound,
        CacheFreshness::Stale(age) => {
            let warning_style = if enable_styles {
                Style::new().fg(Color::Yellow)
            } else {
                Style::default()
            };
            eprintln!(
                "{}",
                warning_style.paint(format!(
                    "The cache hasn't been updated for {} days.\n\
                     You should probably run `tldr --update` soon.",
                    age.as_secs() / 24 / 3600
                ))
            );
            CheckCacheResult::CacheFound
        }
        CacheFreshness::Missing => {
            eprintln!("Cache not found. Please run `tldr --update`.");
            CheckCacheResult::CacheMissing
        }
    }
}
fn check_cache ( args : & Args , enable_styles : bool ) -> CheckCacheResult { match Cache :: freshness ( ) { CacheFreshness :: Fresh => CheckCacheResult :: CacheFound , CacheFreshness :: Stale ( _ ) if args . quiet => CheckCacheResult :: CacheFound , CacheFreshness :: Stale ( age ) => { let warning_style = if enable_styles { Style :: new ( ) . fg ( Color :: Yellow ) } else { Style :: default ( ) } ; eprintln ! ( " " warning_style paint ( format ( " \n \
 " age as_secs ( ) 24 3600 ) ) ) ; CheckCacheResult :: CacheFound } CacheFreshness :: Missing => { eprintln ! ( " " ) ; CheckCacheResult :: CacheMissing } } }
Check the cache for freshness.
Check the cache for freshness .
args
&Args
enable_styles
bool
args
&Args
enable_styles
bool