summaryrefslogtreecommitdiffstats
path: root/src
AgeCommit message (Collapse)Author
2021-04-09Remove unused importsMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-04-03Merge pull request #193 from matthiasbeyer/miscMatthias Beyer
Misc changes
2021-04-01Provide a nice Display impl for ValueKind::{Array, Table}Matthias Beyer
This patch changes the Display impl for ValueKind so that Array and Table are nicely displayed. This basically changes a user-facing implementation in a non-backwards-compatible way. But as the documentation for std states: Display is similar to Debug, but Display is for user-facing output [...] This is user-facing and I'd say this is okay. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-04-01Simplify impl From<Vec<T>> for ValueKindMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-04-01Simplify impl of From<HashMap<String, T>> for ValueKindMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-04-01Remove ConfigKind typeMatthias Beyer
This patch removes the ConfigKind::Frozen mechansim, which wasn't exported through the public interface at all. Because the ::Frozen variant was removed, the ConfigKind::Mutable variant is the only one remaining and because the ConfigKind type isn't exported in the API as well, we can move the variant members to the Config struct itself. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-31Simplify implementationMatthias Beyer
This patch simplifies the Source::collect_to() default implementation by making use of the ? operator as well as the std::iter API. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-31Fix: Remove allow(dead_code)Matthias Beyer
And remove the dead code bit. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-31Fix: Add missing Config::freeze() functionMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-28Rename get_str() → get_string() to match returned typeCaleb Maclennan
2021-03-26Merge pull request #184 from matthiasbeyer/config-only-default-constructorMatthias Beyer
Remove Config::new()
2021-03-26Fix custom separator for group prefixesLyuben Todorov
2021-03-26Remove Config::new()Matthias Beyer
Removes the ::new() constructor, because Config::default() does the same. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-19Add doc: Config::set_default()Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-19Add doc: Config:set()Matthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-18port to rust-ini 0.16Fabio Valentini
2021-03-17Merge pull request #172 from matthiasbeyer/add-setterMatthias Beyer
Add setter for setting config value once
2021-03-17Add a Config::set_once() function to set a value once (and let ↵Matthias Beyer
Config::merge() overwrite it later Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-17Add Config::with_merged()Matthias Beyer
This patch adds a builder-pattern version of Config::merge(), which can be used for method-chain-building Config objects. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-16Fix clippy: Use is_empty() instead of comparing to empty stringMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-03-16Clippy: Remove manual implementation of mapMatthias Beyer
Because clippy complains on nightly. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-10-01Run cargo-fmtMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2020-03-14General upgrade for clippy fix and remove of deprecated methods for errorsFederico Pasqua
2019-12-07Merge pull request #119 from vorner/universal-map-keysRyan Leckey
Allow arbitrary types of map keys
2019-12-07Remove automatic lowercaseRyan Leckey
2019-08-22Allow arbitrary types of map keysMichal 'vorner' Vaner
Of particular interest are maps that have numbers or enums as keys. Closes #74.
2019-06-27port to nom 5Geoffroy Couprie
2019-05-09Remove ValueWithKey structGuillem Nieto
While using this library, I end up having lifetime issues with `Config::get`. I've seen that current implementation forces the calleer to match `key` lifetime to the output of the function. My use case is, under some circumstances, return a suffixed version of the config key. Something similar to: ``` if some_condition == true { let key_name = format!("{}_suffix", key); self.config.get(&key_name) } else { self.config.get(key) } ``` This code is noy compiling for me due to conflicting lifetimes. To avoid this, I've started looking to the code and I've found that `key` needed this lifetime because of `ValueWithKey`. The purpouse of this struct seems to be add more information to the errors that are returned to the user. To mitigate this lifetime coupling I've: - Mapped the error on `Config::get` to include the originating key of the current error - Remove all the code related with `ValueWithKey`
2019-05-09Remove try_defaults_from and set_defaults (for now) as '#[serde(default)]' ↵Ryan Leckey
works thanks to #106
2019-04-08Add missing doctyranron
2019-04-08Fix annoying 'invalid type: unit value, expected struct Settings' errortyranron
2019-04-08Bootstrap solutiontyranron
2019-01-03Re-export file source type markers (fixes #91)Ryan Leckey
2018-12-30Tracking a path where an error happens during deserializationMichal 'vorner' Vaner
Related to #83, but doesn't solve that specific problem :-(. That specific error message ("missing field") comes from somewhere else than this library.
2018-12-30Deserializing: Simplify the MapAccess thingMichal 'vorner' Vaner
2018-11-10support reading enums from configEugeen Sablin
2018-09-25Use a build config on Environment instead of a feature flag for #78Ryan Leckey
2018-09-26Treat empty environment variables as unsetPhil Booth
2018-07-02Update readme/changelog for 0.9Ryan Leckey
2018-07-02Run rustfmt (nightly)Ryan Leckey
2018-07-02Merge branch 'feature/ini' of https://github.com/woodgear/config-rsRyan Leckey
2018-07-02Fix test failures from upgrade to nom 4Ryan Leckey
2018-07-02Merge branch 'master' of https://github.com/Geal/config-rsRyan Leckey
2018-07-02Merge branch 'master' of https://github.com/limbo-rs/config-rsRyan Leckey
2018-06-25option rust-inisan.dai
2018-06-15fix doc testsaber.wu
2018-06-15support inisaber.wu
2018-04-09Mark Value docs as textAleksey Ivanov
2018-04-09[Close #70] Support newtype struct deserializationAleksey Ivanov
2018-04-08Add ConfigSerializerXX