repo-trust 0.1.1

A command-line tool that tells you whether an open-source repository deserves your trust — beyond the star count.
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Loader for custom `weights.toml` files.

use crate::models::ModuleWeights;

/// Load a `ModuleWeights` from a TOML file. Falls back to defaults if a
/// field is missing.
pub fn load(path: &std::path::Path) -> anyhow::Result<ModuleWeights> {
    let content = std::fs::read_to_string(path)?;
    let parsed: ModuleWeights = toml::from_str(&content)?;
    Ok(parsed)
}