Skip to main content

safe_migrate/
cache.rs

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}