dotenvy 0.15.7

A well-maintained fork of the dotenv crate
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mod common;

use dotenvy::*;
use std::{env, error::Error, result::Result};

use crate::common::*;

#[test]
fn test_var() -> Result<(), Box<dyn Error>> {
    let dir = make_test_dotenv()?;

    assert_eq!(var("TESTKEY")?, "test_val");

    env::set_current_dir(dir.path().parent().unwrap())?;
    dir.close()?;
    Ok(())
}