1use crate::error::Result;
2use crate::model::CacheData;
3use std::fs;
4use std::path::Path;
5
6pub fn load_cache<P: AsRef<Path>>(path: P) -> Result<CacheData> {
7 let content = fs::read_to_string(path)?;
8 let cache: CacheData = serde_json::from_str(&content)?;
9 Ok(cache)
10}