#![allow(dead_code)] use std::fs; use std::path::Path; use anyhow::{Context, Result}; use crate::data::config::AppConfig; /// Load application configuration from a TOML file. pub fn load_from_path(path: &Path) -> Result { let raw = fs::read_to_string(path) .with_context(|| format!("failed to read configuration file at {}", path.display()))?; let config = toml::from_str::(&raw) .with_context(|| format!("failed to parse configuration file {}", path.display()))?; Ok(config) }