diff options
author | Christian Fochler <mail@christianfochler.de> | 2018-01-29 08:05:59 +0100 |
---|---|---|
committer | Christian Fochler <mail@christianfochler.de> | 2018-01-29 08:05:59 +0100 |
commit | 5ba6b7a437912ff40a216d3f99f963998b408911 (patch) | |
tree | 1b54afaf9c5cce2d9bb7b3a7f2867ae95ca4d568 /src/env.rs | |
parent | 52ed0762dff1514e0cb970528c6432caea479444 (diff) |
add default prefix separator
- no need to add '_' to the prefix
Diffstat (limited to 'src/env.rs')
-rw-r--r-- | src/env.rs | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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, }; |