fix: add more tokio::task::spawn_blocking

This commit is contained in:
monosans
2025-10-01 09:24:55 +03:00
parent 55095173f2
commit b0306c9ec7
5 changed files with 17 additions and 14 deletions
+2 -2
View File
@@ -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())