summaryrefslogtreecommitdiffstats
path: root/src/env.rs
AgeCommit message (Collapse)Author
2023-10-23Fix a doc link by properly marking Vec<String>Ian Jackson
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2023-10-23Fix a doc link to with_list_parse_keyIan Jackson
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk> Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2023-07-22Make the parse list key to lowercase when insert the keysbigduu
Signed-off-by: bigduu <mugeng.du@qq.com>
2023-01-02Copy member docs to builder functionsMatthias Beyer
The members are not visible on docs.rs, so copy their documentation to the respective builder functions so users can see what they're about. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2022-11-07Fix clippy: Do not manually check for NoneMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2022-09-29convert-case: fix for building with this feature excludedDan Aloni
2022-09-29env: add a 'convert_case' field to ease dealing with kebab-caseDan Aloni
This allows usage of `kebab-case` attribute in serde, mapping unambiguously into a config value given a multiple character separator. This also add the `convert-case` feature. For example: let environment = Environment::default() .prefix("PREFIX") .translate_key(Case::Kebab) .separator("__");
2022-09-29Environment: add a rustdoc commentDan Aloni
2022-03-11chore: add the possibility to keep the prefix from env var.Jérémy Audiger
2022-02-28feat: env contains list of stringssimon-an
Signed-off-by: simon-an <26556185+simon-an@users.noreply.github.com>
2022-02-24add prefix separator supportConrad Ludgate
2022-01-29use 'Self' to refer to own typeDaniel Eades
2021-12-29de-glob importsDaniel Eades
2021-12-28Add #[must_use] annotationsMatthias Beyer
Clippy nightly fails the checks because it wants us to have a `#[must_use]` annotation on functions that return `Self`. So we add these annotations with this patch. Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-11-26Merge pull request #242 from ctron/feature/provide_env_1Matthias Beyer
feat: allow providing the environment for testing
2021-11-22feat: allow providing the environment for testingJens Reimann
closes #241 Co-authored-by: Conrad Ludgate <conradludgate@gmail.com>
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-10-02Add deprecation notice to Environment::newMatthias Beyer
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
2021-10-02Fix clippy: Remove Default impl for Environment, derive itMatthias Beyer
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-09refactor(env): optimize and reduce allocationsEduardo Canellas
2021-05-04Fix env tests, remove unused importJohn Brandt
2021-05-04Add perfromance note to `try_parsing`John Brandt
2021-05-04reduce env parsing repetitionJohn Brandt
2021-05-04more predictable env parsing and reduced clonesJohn Brandt
2021-05-04clearer env bool parse ifJohn Brandt
2021-05-04If env value is true or false parse as boolJohn Brandt
2021-05-04Renames parse_numbers to try_parsingJoel Gallant
2021-05-04Uses into_* for value conversions and adds bool as an optionJoel Gallant
2021-05-04Adds 'parse_numbers' options for EnvironmentJoel Gallant
This can be particularly helpful for `MY_SERVER_PORT=4334 cargo run`
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-26Fix custom separator for group prefixesLyuben Todorov
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-03-14General upgrade for clippy fix and remove of deprecated methods for errorsFederico Pasqua
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-01-29add default prefix separatorChristian Fochler
- no need to add '_' to the prefix
2018-01-28make separator optionalChristian Fochler
2018-01-28Revert "remove unnecessary env key manipulation"Christian Fochler
This reverts commit 36b477df0f9bda4d153b674b3007ee087e44d67f.
2017-12-14remove unnecessary env key manipulationChristian Fochler
2017-07-30Remove ConfigResult; close #36Ryan Leckey
2017-06-22Add builder API to ConfigRyan Leckey
2017-06-16Fix a couple issues, mainly with env sourceRyan Leckey
2017-06-13Add EnvironmentRyan Leckey
2017-03-08Initial work on deep serde integrationRyan Leckey