File tree Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Expand file tree Collapse file tree 3 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -110,8 +110,7 @@ impl Config {
110
110
where
111
111
T : Into < Value > ,
112
112
{
113
- self . defaults
114
- . insert ( key. to_lowercase ( ) . as_str ( ) . parse ( ) ?, value. into ( ) ) ;
113
+ self . defaults . insert ( key. parse ( ) ?, value. into ( ) ) ;
115
114
116
115
#[ allow( deprecated) ]
117
116
self . refresh ( )
@@ -130,16 +129,15 @@ impl Config {
130
129
where
131
130
T : Into < Value > ,
132
131
{
133
- self . overrides
134
- . insert ( key. to_lowercase ( ) . as_str ( ) . parse ( ) ?, value. into ( ) ) ;
132
+ self . overrides . insert ( key. parse ( ) ?, value. into ( ) ) ;
135
133
136
134
#[ allow( deprecated) ]
137
135
self . refresh ( )
138
136
}
139
137
140
138
#[ deprecated( since = "0.12.0" , note = "please use 'ConfigBuilder' instead" ) ]
141
139
pub fn set_once ( & mut self , key : & str , value : Value ) -> Result < ( ) > {
142
- let expr: path:: Expression = key. to_lowercase ( ) . as_str ( ) . parse ( ) ?;
140
+ let expr: path:: Expression = key. parse ( ) ?;
143
141
144
142
// Traverse the cache using the path to (possibly) retrieve a value
145
143
if let Some ( ref mut val) = expr. get_mut ( & mut self . cache ) {
@@ -151,8 +149,6 @@ impl Config {
151
149
}
152
150
153
151
fn get_value ( & self , key : & str ) -> Result < Value > {
154
- let k = key. to_lowercase ( ) ;
155
- let key = k. as_str ( ) ;
156
152
// Parse the key into a path expression
157
153
let expr: path:: Expression = key. parse ( ) ?;
158
154
Original file line number Diff line number Diff line change @@ -74,5 +74,5 @@ fn respect_path_case() {
74
74
. build ( )
75
75
. unwrap ( ) ;
76
76
77
- c. get_string ( "Student[0].Name" ) . unwrap_err ( ) ;
77
+ c. get_string ( "Student[0].Name" ) . unwrap ( ) ;
78
78
}
Original file line number Diff line number Diff line change @@ -116,6 +116,6 @@ fn test_set_capital() {
116
116
. unwrap ( ) ;
117
117
118
118
assert_eq ! ( config. get:: <bool >( "this" ) . unwrap( ) , false ) ;
119
- config. get :: < bool > ( "ThAt" ) . unwrap_err ( ) ;
120
- config. get :: < usize > ( "logLevel" ) . unwrap_err ( ) ;
119
+ assert_eq ! ( config. get:: <bool >( "ThAt" ) . unwrap ( ) , true ) ;
120
+ assert_eq ! ( config. get:: <usize >( "logLevel" ) . unwrap ( ) , 5 ) ;
121
121
}
You can’t perform that action at this time.
0 commit comments