1# Change Log
2All notable changes to this project will be documented in this file.
3
4The format is based on [Keep a Changelog](http://keepachangelog.com/)
5and this project adheres to [Semantic Versioning](http://semver.org/).
6
7## Unreleased
8
9## 0.13.4 - 2023-11-22
10
11- Relaxed the MSRV to 1.56.0 for this release. Please have a look at
12  [#495] for details
13- Backport of the following patches from PR [#465]:
14  - [aa63d2dbbcc13fbdfa846185d54d87d7822e2509]
15  - [831102fe0ffd5c7fe475efe5f379c710d201f165]
16  - [147e6c7275b65b6a74eaec9c05b317673e61084e]
17  - [ed6a3c9882fbc43eae9313ab1801610e49af863f]
18  to fix nested arrays (see
19  [the related bug report](https://github.com/mehcode/config-rs/issues/464)
20  for details).
21
22[#495]: https://github.com/mehcode/config-rs/pull/495
23[#465]: https://github.com/mehcode/config-rs/pull/465
24[aa63d2dbbcc13fbdfa846185d54d87d7822e2509]: https://github.com/mehcode/config-rs/commit/aa63d2dbbcc13fbdfa846185d54d87d7822e2509
25[831102fe0ffd5c7fe475efe5f379c710d201f165]: https://github.com/mehcode/config-rs/commit/831102fe0ffd5c7fe475efe5f379c710d201f165
26[147e6c7275b65b6a74eaec9c05b317673e61084e]: https://github.com/mehcode/config-rs/commit/147e6c7275b65b6a74eaec9c05b317673e61084e
27[ed6a3c9882fbc43eae9313ab1801610e49af863f]: https://github.com/mehcode/config-rs/commit/ed6a3c9882fbc43eae9313ab1801610e49af863f
28
29## 0.13.3 - 2022-12-04
30
31Please note that we had to update the MSRV for this crate from 1.56.0 to 1.59.0
32for this patch release being possible, because a transitive dependency did
33update its MSRV.
34
35 - Backport of commit [d54986c54091e4620c199d3dfadde80b82958bb3] from [#362] for
36   using float_cmp for testing floats
37 - Backport of [#379] adding `Clone` trait derive to builder states
38
39[d54986c54091e4620c199d3dfadde80b82958bb3]: https://github.com/mehcode/config-rs/commit/d54986c54091e4620c199d3dfadde80b82958bb3
40[#362]: https://github.com/mehcode/config-rs/pull/362
41[#379]: https://github.com/mehcode/config-rs/pull/379
42
43## 0.13.2 - 2022-08-02
44
45 - Backport of [#316] to be testing with temp_env. The backport was necessary to
46   be able to backport the next change. This change shouldn't be user-visible.
47 - Backport of [#353] to use TryInto for more permissive deserialization of
48   integers
49 - Backport of commit [518a3cafa1e62ba7405709e5c508247e328e0a18] from [#362] to
50   fix tests
51
52[#316]: https://github.com/mehcode/config-rs/pull/316
53[#353]: https://github.com/mehcode/config-rs/pull/353
54[518a3cafa1e62ba7405709e5c508247e328e0a18]: https://github.com/mehcode/config-rs/commit/518a3cafa1e62ba7405709e5c508247e328e0a18
55[#362]: https://github.com/mehcode/config-rs/pull/362
56
57## 0.13.1 - 2022-04-13
58
59 - typo in doc comment for ConfigBuilder [#299]
60 - dot in config file name handling fixed [#306]
61
62[#299]: https://github.com/mehcode/config-rs/pull/299
63[#306]: https://github.com/mehcode/config-rs/pull/306
64
65## 0.13.0 - 2022-04-03
66
67 - Prefix-Seperator support was added [#292]
68 - Environment lists can now be parsed [#255]
69 - Setting an overwrite from an Option was added [#303]
70 - Option to keep the prefix from an environment variable was added [#298]
71 - Some small doc/CI fixes [#307], [#309]
72 - MSRV was updated to 1.56.0 [#304]
73 - Dependencies were updated [#289], [#301]
74
75[#292]: https://github.com/mehcode/config-rs/pull/292
76[#255]: https://github.com/mehcode/config-rs/pull/255
77[#303]: https://github.com/mehcode/config-rs/pull/303
78[#298]: https://github.com/mehcode/config-rs/pull/298
79[#307]: https://github.com/mehcode/config-rs/pull/307
80[#309]: https://github.com/mehcode/config-rs/pull/309
81[#304]: https://github.com/mehcode/config-rs/pull/304
82[#289]: https://github.com/mehcode/config-rs/pull/289
83[#301]: https://github.com/mehcode/config-rs/pull/301
84
85## 0.12.0 - 2022-02-10
86
87### Format support changes in this version
88
89 - HJSON support was removed [#230]
90 - JSON5 format support [#206]
91 - RON format support [#202]
92
93### Other noteworthy changes
94
95 - A new ConfigBuilder interface for building configuration objects [#196]
96 - Asynchronous sources [#207]
97 - Custom ENV separators are now supported [#185]
98 - Loads of dependency updates and bugfixes of course
99 - Preserved map order [#217]
100 - Support for parsing numbers from the environment [#137]
101 - Support for unsigned integers [#178]
102 - `Format` trait for (custom) file formats [#219]
103
104### Deprecated
105
106 - `Environment::new()` - see [#235]
107 - Large parts of the `Config` interface - see [#196]
108     - `Config::merge()`
109     - `Config::with_merged()`
110     - `Config::refresh()`
111     - `Config::set_default()`
112     - `Config::set()`
113     - `Config::set_once()`
114     - `Config::deserialize()`
115
116[#137]: https://github.com/mehcode/config-rs/pull/137
117[#178]: https://github.com/mehcode/config-rs/pull/178
118[#185]: https://github.com/mehcode/config-rs/pull/185
119[#196]: https://github.com/mehcode/config-rs/pull/196
120[#202]: https://github.com/mehcode/config-rs/pull/202
121[#206]: https://github.com/mehcode/config-rs/pull/206
122[#207]: https://github.com/mehcode/config-rs/pull/207
123[#217]: https://github.com/mehcode/config-rs/pull/217
124[#219]: https://github.com/mehcode/config-rs/pull/219
125[#230]: https://github.com/mehcode/config-rs/pull/230
126[#235]: https://github.com/mehcode/config-rs/pull/235
127
128## 0.11.0 - 2021-03-17
129 - The `Config` type got a builder-pattern `with_merged()` method [#166].
130 - A `Config::set_once()` function was added, to set an value that can be
131   overwritten by `Config::merge`ing another configuration [#172]
132 - serde_hjson is, if enabled, pulled in without default features.
133   This is due to a bug in serde_hjson, see [#169] for more information.
134 - Testing is done on github actions [#175]
135
136[#166]: https://github.com/mehcode/config-rs/pull/166
137[#172]: https://github.com/mehcode/config-rs/pull/172
138[#169]: https://github.com/mehcode/config-rs/pull/169
139[#175]: https://github.com/mehcode/config-rs/pull/169
140
141## 0.10.1 - 2019-12-07
142 - Allow enums as configuration keys [#119]
143
144[#119]: https://github.com/mehcode/config-rs/pull/119
145
146## 0.10.0 - 2019-12-07
147 - Remove lowercasing of keys (unless the key is coming from an environment variable).
148 - Update nom to 5.x
149
150## 0.9.3 - 2019-05-09
151 - Support deserializing to a struct with `#[serde(default)]` [#106]
152
153[#106]: https://github.com/mehcode/config-rs/pull/106
154
155## 0.9.2 - 2019-01-03
156 - Support reading `enum`s from configuration. [#85]
157 - Improvements to error path (attempting to propagate path). [#89]
158 - Fix UB in monomorphic expansion. We weren't re-exporting dependent types. [#91]
159
160[#85]: https://github.com/mehcode/config-rs/pull/85
161[#89]: https://github.com/mehcode/config-rs/pull/89
162[#91]: https://github.com/mehcode/config-rs/issues/91
163
164## 0.9.1 - 2018-09-25
165 - Allow Environment variable collection to ignore empty values. [#78]
166   ```rust
167   // Empty env variables will not be collected
168   Environment::with_prefix("APP").ignore_empty(true)
169   ```
170
171[#78]: https://github.com/mehcode/config-rs/pull/78
172
173## 0.9.0 - 2018-07-02
174 - **Breaking Change:** Environment does not declare a separator by default.
175    ```rust
176    // 0.8.0
177    Environment::with_prefix("APP")
178
179    // 0.9.0
180    Environment::with_prefix("APP").separator("_")
181    ```
182
183 - Add support for INI. [#72]
184 - Add support for newtype structs. [#71]
185 - Fix bug with array set by path. [#69]
186 - Update to nom 4. [#63]
187
188[#72]: https://github.com/mehcode/config-rs/pull/72
189[#71]: https://github.com/mehcode/config-rs/pull/71
190[#69]: https://github.com/mehcode/config-rs/pull/69
191[#63]: https://github.com/mehcode/config-rs/pull/63
192
193## 0.8.0 - 2018-01-26
194 - Update lazy_static and yaml_rust
195
196## 0.7.1 - 2018-01-26
197 - Be compatible with nom's verbose_errors feature (#50)[https://github.com/mehcode/config-rs/pull/50]
198 - Add `derive(PartialEq)` for Value (#54)[https://github.com/mehcode/config-rs/pull/54]
199
200## 0.7.0 - 2017-08-05
201 - Fix conflict with `serde_yaml`. [#39]
202
203[#39]: https://github.com/mehcode/config-rs/issues/39
204
205 - Implement `Source` for `Config`.
206 - Implement `serde::de::Deserializer` for `Config`. `my_config.deserialize` may now be called as either `Deserialize::deserialize(my_config)` or `my_config.try_into()`.
207 - Remove `ConfigResult`. The builder pattern requires either `.try_into` as the final step _or_ the initial `Config::new()` to be bound to a slot. Errors must also be handled on each call instead of at the end of the chain.
208
209
210    ```rust
211    let mut c = Config::new();
212    c
213        .merge(File::with_name("Settings")).unwrap()
214        .merge(Environment::with_prefix("APP")).unwrap();
215    ```
216
217    ```rust
218    let c = Config::new()
219        .merge(File::with_name("Settings")).unwrap()
220        .merge(Environment::with_prefix("APP")).unwrap()
221        // LLVM should be smart enough to remove the actual clone operation
222        // as you are cloning a temporary that is dropped at the same time
223        .clone();
224    ```
225
226    ```rust
227    let mut s: Settings = Config::new()
228        .merge(File::with_name("Settings")).unwrap()
229        .merge(Environment::with_prefix("APP")).unwrap()
230        .try_into();
231    ```
232
233## 0.6.0 – 2017-06-22
234  - Implement `Source` for `Vec<T: Source>` and `Vec<Box<Source>>`
235
236    ```rust
237    Config::new()
238        .merge(vec![
239            File::with_name("config/default"),
240            File::with_name(&format!("config/{}", run_mode)),
241        ])
242    ```
243
244  - Implement `From<&Path>` and `From<PathBuf>` for `File`
245
246  - Remove `namespace` option for File
247  - Add builder pattern to condense configuration
248
249    ```rust
250    Config::new()
251        .merge(File::with_name("Settings"))
252        .merge(Environment::with_prefix("APP"))
253        .unwrap()
254    ```
255
256 - Parsing errors even for non required files – [@Anthony25] ( [#33] )
257
258[@Anthony25]: https://github.com/Anthony25
259[#33]: https://github.com/mehcode/config-rs/pull/33
260
261## 0.5.1 – 2017-06-16
262 - Added config category to Cargo.toml
263
264## 0.5.0 – 2017-06-16
265 - `config.get` has been changed to take a type parameter and to deserialize into that type using serde. Old behavior (get a value variant) can be used by passing `config::Value` as the type parameter: `my_config.get::<config::Value>("..")`. Some great help here from [@impowski] in [#25].
266 - Propagate parse and type errors through the deep merge (remembering filename, line, etc.)
267 - Remove directory traversal on `File`. This is likely temporary. I do _want_ this behavior but I can see how it should be optional. See [#35]
268 - Add `File::with_name` to get automatic file format detection instead of manual `FileFormat::*` – [@JordiPolo]
269 - Case normalization [#26]
270 - Remove many possible panics [#8]
271 - `my_config.refresh()` will do a full re-read from the source so live configuration is possible with some work to watch the file
272
273[#8]: https://github.com/mehcode/config-rs/issues/8
274[#35]: https://github.com/mehcode/config-rs/pull/35
275[#26]: https://github.com/mehcode/config-rs/pull/26
276[#25]: https://github.com/mehcode/config-rs/pull/25
277
278[@impowski]: https://github.com/impowski
279[@JordiPolo]: https://github.com/JordiPolo
280
281## 0.4.0 - 2017-02-12
282 - Remove global ( `config::get` ) API — It's now required to create a local configuration instance with `config::Config::new()` first.
283
284   If you'd like to have a global configuration instance, use `lazy_static!` as follows:
285
286   ```rust
287   use std::sync::RwLock;
288   use config::Config;
289
290   lazy_static! {
291       static ref CONFIG: RwLock<Config> = Default::default();
292   }
293   ```
294
295## 0.3.0 - 2017-02-08
296 - YAML from [@tmccombs](https://github.com/tmccombs)
297 - Nested field retrieval
298 - Deep merging of sources (was shallow)
299 - `config::File::from_str` to parse and merge a file from a string
300 - Support for retrieval of maps and slices — `config::get_table` and `config::get_array`
301
302## 0.2.0 - 2017-01-29
303Initial release.
304