notes 0.2.0-20200824

A simple tool for taking notes. Work in progress. See: https://gitlab.com/remipassmoilesel/notes
use std::env;
use std::env::VarError;

#[cfg(test)]
use mockall::automock;

#[cfg_attr(test, automock)]
pub trait Env {
    fn get(&self, key: &str) -> Result<String, VarError>;
}

pub struct EnvImpl;

impl EnvImpl {
    pub fn new() -> EnvImpl {
        EnvImpl {}
    }
}

impl Env for EnvImpl {
    fn get(&self, key: &str) -> Result<String, VarError> {
        env::var(key)
    }
}