cfgmatic-paths 5.0.0

Cross-platform configuration path discovery following XDG and platform conventions
Documentation
//! Environment abstraction for testing.

mod std_env;

pub use std_env::StdEnv;

use std::path::PathBuf;

/// Abstraction over environment variables for testing.
///
/// Allows mocking environment variables in tests without using
/// `std::env::set_var`, which can cause race conditions.
pub trait Env: Send + Sync {
    /// Get an environment variable value.
    fn get(&self, key: &str) -> Option<String>;

    /// Get the user's home directory.
    fn home_dir(&self) -> Option<PathBuf>;
}