File tree 1 file changed +16
-2
lines changed
1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1230,7 +1230,14 @@ impl Ini {
1230
1230
} else {
1231
1231
section. to_lowercase ( )
1232
1232
} ;
1233
- self . map . remove ( & section)
1233
+ #[ cfg( not( feature = "indexmap" ) ) ]
1234
+ {
1235
+ self . map . remove ( & section)
1236
+ }
1237
+ #[ cfg( feature = "indexmap" ) ]
1238
+ {
1239
+ self . map . swap_remove ( & section)
1240
+ }
1234
1241
}
1235
1242
1236
1243
///Removes a key from a section in the hashmap, returning the value attached to the key if it was previously in the map.
@@ -1250,7 +1257,14 @@ impl Ini {
1250
1257
///Returns `Some(Option<String>)` if the value exists or else, `None`.
1251
1258
pub fn remove_key ( & mut self , section : & str , key : & str ) -> Option < Option < String > > {
1252
1259
let ( section, key) = self . autocase ( section, key) ;
1253
- self . map . get_mut ( & section) ?. remove ( & key)
1260
+ #[ cfg( not( feature = "indexmap" ) ) ]
1261
+ {
1262
+ self . map . get_mut ( & section) ?. remove ( & key)
1263
+ }
1264
+ #[ cfg( feature = "indexmap" ) ]
1265
+ {
1266
+ self . map . get_mut ( & section) ?. swap_remove ( & key)
1267
+ }
1254
1268
}
1255
1269
}
1256
1270
You can’t perform that action at this time.
0 commit comments