confyg 0.3.0

A simple, TOML-based, ENV-enabled library that can find and merge configs
Documentation
use std::error::Error;
use std::fmt::{Display, Formatter, Result};

#[derive(Debug, Eq, PartialEq)]
pub enum FinderError {
    NotFound(String),
    PathConversion(String),
}

impl Error for FinderError {}

impl Display for FinderError {
    fn fmt(&self, f: &mut Formatter) -> Result {
        match self {
            FinderError::NotFound(filename) => write!(f, "couldn't find file {filename}."),
            FinderError::PathConversion(path) => {
                write!(f, "path contains invalid UTF-8: {path}")
            }
        }
    }
}

impl From<&str> for FinderError {
    fn from(filename: &str) -> Self {
        FinderError::NotFound(filename.to_string())
    }
}