From ae4b1e85e669bc882d158509ef1eda46c6b2a72e Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 30 May 2025 19:36:59 -0800 Subject: fix clippy issues and improve formatting everywhere --- azalea-auth/src/cache.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'azalea-auth/src/cache.rs') diff --git a/azalea-auth/src/cache.rs b/azalea-auth/src/cache.rs index ca32958f..9207c46e 100644 --- a/azalea-auth/src/cache.rs +++ b/azalea-auth/src/cache.rs @@ -1,22 +1,23 @@ //! Cache auth information +use std::io; use std::path::Path; use std::time::{SystemTime, UNIX_EPOCH}; use serde::{Deserialize, Serialize}; use thiserror::Error; -use tokio::fs::File; +use tokio::fs::{self, File}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tracing::{debug, trace}; #[derive(Debug, Error)] pub enum CacheError { #[error("Failed to read cache file: {0}")] - Read(std::io::Error), + Read(io::Error), #[error("Failed to write cache file: {0}")] - Write(std::io::Error), + Write(io::Error), #[error("Failed to create cache file directory: {0}")] - MkDir(std::io::Error), + MkDir(io::Error), #[error("Failed to parse cache file: {0}")] Parse(serde_json::Error), } @@ -94,7 +95,9 @@ async fn set_entire_cache(cache_file: &Path, cache: Vec) -> Resul "Making cache file parent directory at {}", cache_file_parent.to_string_lossy() ); - std::fs::create_dir_all(cache_file_parent).map_err(CacheError::MkDir)?; + fs::create_dir_all(cache_file_parent) + .await + .map_err(CacheError::MkDir)?; } let mut cache_file = File::create(cache_file).await.map_err(CacheError::Write)?; let cache = serde_json::to_string_pretty(&cache).map_err(CacheError::Parse)?; -- cgit v1.2.3