summaryrefslogtreecommitdiffstats
path: root/src/env.rs
diff options
context:
space:
mode:
authorChristian Fochler <mail@christianfochler.de>2018-01-29 08:05:59 +0100
committerChristian Fochler <mail@christianfochler.de>2018-01-29 08:05:59 +0100
commit5ba6b7a437912ff40a216d3f99f963998b408911 (patch)
tree1b54afaf9c5cce2d9bb7b3a7f2867ae95ca4d568 /src/env.rs
parent52ed0762dff1514e0cb970528c6432caea479444 (diff)
add default prefix separator
- no need to add '_' to the prefix
Diffstat (limited to 'src/env.rs')
-rw-r--r--src/env.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/env.rs b/src/env.rs
index 5f7e92f..b26dc56 100644
--- a/src/env.rs
+++ b/src/env.rs
@@ -9,10 +9,10 @@ pub struct Environment {
/// Optional prefix that will limit access to the environment to only keys that
/// begin with the defined prefix.
///
- /// A prefix is tested to be present on each key before its considered
+ /// A prefix with a separator of `_` is tested to be present on each key before its considered
/// to be part of the source environment.
///
- /// For example, the key `CONFIG_DEBUG` would become `DEBUG` with a prefix of `config_`.
+ /// For example, the key `CONFIG_DEBUG` would become `DEBUG` with a prefix of `config`.
prefix: Option<String>,
/// Optional character sequence that separates each key segment in an environment key pattern.
@@ -69,7 +69,7 @@ impl Source for Environment {
// Define a prefix pattern to test and exclude from keys
let prefix_pattern = match self.prefix {
- Some(ref prefix) => Some(prefix.clone() + &separator),
+ Some(ref prefix) => Some(prefix.clone() + "_"),
_ => None,
};