fix: add more tokio::task::spawn_blocking
This commit is contained in:
@@ -10,9 +10,9 @@ pub async fn get_cache_path() -> crate::Result<PathBuf> {
|
||||
|
||||
Ok(CACHE
|
||||
.get_or_try_init(async || -> crate::Result<PathBuf> {
|
||||
let mut path = dirs::cache_dir()
|
||||
let mut path = tokio::task::spawn_blocking(dirs::cache_dir)
|
||||
.await?
|
||||
.ok_or_eyre("failed to get user's cache directory")?;
|
||||
#[expect(clippy::pathbuf_init_then_push)]
|
||||
path.push(APP_DIRECTORY_NAME);
|
||||
tokio::fs::create_dir_all(&path).await.wrap_err_with(|| {
|
||||
format!("failed to create directory: {}", path.display())
|
||||
|
||||
Reference in New Issue
Block a user