diff --git a/src/fs.rs b/src/fs.rs index 75ea132..cc90896 100644 --- a/src/fs.rs +++ b/src/fs.rs @@ -4,10 +4,10 @@ use color_eyre::eyre::{OptionExt as _, WrapErr as _}; use crate::config::APP_DIRECTORY_NAME; -static CACHE: tokio::sync::OnceCell = - tokio::sync::OnceCell::const_new(); - pub async fn get_cache_path() -> crate::Result { + static CACHE: tokio::sync::OnceCell = + tokio::sync::OnceCell::const_new(); + Ok(CACHE .get_or_try_init(async || -> crate::Result { let mut path = tokio::task::spawn_blocking(dirs::cache_dir)