@@ -20,13 +20,15 @@ pub struct Environment {
20
20
/// Optional prefix that will limit access to the environment to only keys that
21
21
/// begin with the defined prefix.
22
22
///
23
- /// A prefix with a separator of `_` is tested to be present on each key before its considered
24
- /// to be part of the source environment.
23
+ /// The prefix is tested to be present on each key before it's considered to be part of the
24
+ /// source environment. The separator character can be set through
25
+ /// [`prefix_separator`](Environment::prefix_separator()).
25
26
///
26
27
/// For example, the key `CONFIG_DEBUG` would become `DEBUG` with a prefix of `config`.
27
28
prefix : Option < String > ,
28
29
29
- /// Optional character sequence that separates the prefix from the rest of the key
30
+ /// Optional character sequence that separates the prefix from the rest of the key.
31
+ /// Defaults to [`separator`](Environment::separator()) if that is set, otherwise `_`.
30
32
prefix_separator : Option < String > ,
31
33
32
34
/// Optional character sequence that separates each key segment in an environment key pattern.
@@ -96,8 +98,9 @@ impl Environment {
96
98
/// Optional prefix that will limit access to the environment to only keys that
97
99
/// begin with the defined prefix.
98
100
///
99
- /// A prefix with a separator of `_` is tested to be present on each key before its considered
100
- /// to be part of the source environment.
101
+ /// The prefix is tested to be present on each key before it's considered to be part of the
102
+ /// source environment. The separator character can be set through
103
+ /// [`prefix_separator`](Environment::prefix_separator()).
101
104
///
102
105
/// For example, the key `CONFIG_DEBUG` would become `DEBUG` with a prefix of `config`.
103
106
pub fn with_prefix ( s : & str ) -> Self {
@@ -124,7 +127,8 @@ impl Environment {
124
127
self
125
128
}
126
129
127
- /// Optional character sequence that separates the prefix from the rest of the key
130
+ /// Optional character sequence that separates the prefix from the rest of the key.
131
+ /// Defaults to [`separator`](Environment::separator()) if that is set, otherwise `_`.
128
132
pub fn prefix_separator ( mut self , s : & str ) -> Self {
129
133
self . prefix_separator = Some ( s. into ( ) ) ;
130
134
self
0 commit comments