missing refactor
This commit is contained in:
parent
e95f18c22c
commit
93ec52f555
1 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue