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