1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright 2020 Peter Williams <peter@newton.cx> and collaborators
// Licensed under the MIT License.
//! Helpers for environment variables.
use anyhow;
use env;
use crateResult;
/// Get an optional environment variable as a string.
///
/// If the variable is not present or is empty, return `Ok(None)`. If the
/// variable is present but cannot be converted into a string, return an `Err`.
/// Require an environment variable as a string.
///
/// If the variable is not present, or is empty, or cannot be converted into a
/// string, return an `Err`.