safe-migrate 0.2.1

Lint PostgreSQL migrations against live database statistics to prevent blocking locks
Documentation
1
2
3
4
5
6
7
8
9
10
use crate::error::Result;
use crate::model::CacheData;
use std::fs;
use std::path::Path;

pub fn load_cache<P: AsRef<Path>>(path: P) -> Result<CacheData> {
    let content = fs::read_to_string(path)?;
    let cache: CacheData = serde_json::from_str(&content)?;
    Ok(cache)
}