summaryrefslogtreecommitdiffstats
path: root/src/de.rs
AgeCommit message (Collapse)Author
2023-10-23impl Deserializer for Config: forward everything to cacheIan Jackson
This had open-coded copies of the impl for Value. Replace them with calls to the impl for Value. This reduces duplication. It would allow us to change the impl for Value. Use a macro for the many very-similar functions. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
2023-02-10Fix clippy: Remove needless borrowed referenceMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2022-09-17Merge pull request #354 from YounessBird/fix-uppercase-lowercase-issesMatthias Beyer
Fix uppercase lowercase isses
2022-09-06Fix FIXME in de.rs and value.rs.BratSinot
2022-07-14refactoring deserialize-any in configYounessBird
2022-07-05enabling deserialization of lowercase values to enumsYounessBird
2022-06-28Use TryInto for more permissive deserialization for integersKesavan Yogeswaran
* Attempt to convert between integer types using `TryInto`-based conversions rather than blanket failing for some source and destination types. * Use `into_uint` instead of `into_int` in `Value` Deserialize implementations for unsigned integer types. Previously, we were converting from signed types to unsigned types using `as`, which can lead to surprise integer values conversions (#93). Fixes #352 and #93
2022-01-29use 'Self' to refer to own typeDaniel Eades
2021-12-29remove needless pass by valueDaniel Eades
2021-12-29de-glob importsDaniel Eades
2021-12-28use explicit imports for macrosDaniel Eades
2021-11-21Add support for unsigned integersMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-11-21Remove support for integers smaller than i64Matthias Beyer
All our backend crates do not support integers smaller than i64, so there's no point in supporting them either. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-11-21Add support for different sized integersMatthias Beyer
This also enables support for 128 bit integers. Nothing is tested, though. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-08-15Rename MapImpl to MapDavid Orchard
2021-08-15Move order preservation under a feature gateDavid Orchard
2021-08-15Use LinkedHashMap in place of HashMapDavid Orchard
2021-06-08Fix clippy: Do not borrow referenceMatthias Beyer
Reported from nightly clippy, this borrowing of a reference is uneccessary. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-04-09Ensure order in the galaxy... I mean the importsMatthias Beyer
This patch sorts the imports: 1. std imports 2. external crate imports 3. own module imports In three blocks, each alphabetically (with is also enforced by rustfmt). As well as it prefixes the imports of own modules with crate:: This is just a quality-of-life patch :-) 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-28Rename get_str() → get_string() to match returned typeCaleb Maclennan
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-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`
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-07-02Run rustfmt (nightly)Ryan Leckey
2018-04-09[Close #70] Support newtype struct deserializationAleksey Ivanov
2017-07-30Impl Deserializer for Config (to forward Value)Ryan Leckey
2017-07-30Remove ConfigResult; close #36Ryan Leckey
2017-06-03More context for errors (value key if possible)Ryan Leckey
2017-06-01Move things around and get some tests in placeRyan Leckey