missing refactor

This commit is contained in:
Felipe 2025-12-27 17:13:12 -03:00
parent e95f18c22c
commit 93ec52f555
Signed by: pitbuster
SSH key fingerprint: SHA256:NLWXDJvkNDPTnUszcKt0McVeXWKTe5Lz0cIocZbA/pY

View file

@ -7,7 +7,7 @@ use tokio_stream::StreamExt;
use tokio_util::io::StreamReader; use tokio_util::io::StreamReader;
use tracing::debug; use tracing::debug;
use super::models::Index; use super::models::RawIndex;
use crate::directories::data_cache_directory; use crate::directories::data_cache_directory;
/// Client to download data from mallie.io /// Client to download data from mallie.io
@ -41,12 +41,12 @@ impl Client {
Ok(()) Ok(())
} }
async fn load_tcgl_index(&self) -> Result<Index> { async fn load_tcgl_index(&self) -> Result<RawIndex> {
let file_path = self.data_cache_directory.join("tcgl_index.json"); let file_path = self.data_cache_directory.join("tcgl_index.json");
let index = tokio::fs::read_to_string(&file_path) let index = tokio::fs::read_to_string(&file_path)
.await .await
.with_context(|| format!("Failed to read {file_path}"))?; .with_context(|| format!("Failed to read {file_path}"))?;
let index: Index = let index: RawIndex =
serde_json::from_str(&index).with_context(|| format!("Couldn't parse {file_path}"))?; serde_json::from_str(&index).with_context(|| format!("Couldn't parse {file_path}"))?;
Ok(index) Ok(index)
} }