16 Commits

Author SHA1 Message Date
Lukas Kalbertodt
4fdfb821dc Fix enum deserialization from env values
Fixes #31
2023-07-02 10:17:49 +02:00
Lukas Kalbertodt
079738be65 Wrap long lines 2023-01-15 17:02:43 +01:00
Lukas Kalbertodt
c6ee971f0d Add test to make sure all emitted symbols use fully qualified paths 2022-11-25 10:00:47 +01:00
Lukas Kalbertodt
e2dded17fa Change parse_env error type from Debug to impl std::error::Error
This is the more appropriate trait I think and should work well for
most real world use cases.
2022-11-06 11:23:57 +01:00
Cyphersnake
cb8f879b92 Add parse_env attribute to confique::Config macro
Since there is no established format for representing collections within env variables, to enable their support, the feature with a custom parser attribute added.

Add helpers for parsing env variables into collections

Improve rustdoc for `env_utils` functions

Improve `parse_env` example
2022-11-06 10:18:42 +04:00
Lukas Kalbertodt
0e47eb7acf Format code
This is `cargo fmt` but with lots of changes reverted and some adjusted.
2022-10-24 10:13:06 +02:00
Lukas Kalbertodt
d1a62e47eb Add map default values (e.g. default = { "foo": 33 })
This commit also adds a bunch of tests testing maps in several
situations.
2022-10-21 18:13:59 +02:00
Lukas Kalbertodt
093957b515 Add array default value to formatting test example 1 2022-10-21 17:22:03 +02:00
Lukas Kalbertodt
9b9610a6ac Add JSON5 support 2022-10-21 11:52:53 +02:00
Lukas Kalbertodt
6a9ccd4e22 Do major refactor of format code
This gets rid of a lot of duplicated logic that was previously
copy&pasted. This commit alos:
- Makes it easier to implement new formats
- Gets rid of a few bugs
- Makes the system more flexible (more options)
- Adds a lot of additional tests
2022-10-19 17:12:32 +02:00
Lukas Kalbertodt
4f5c458150 Add YAML formatting tests 2022-10-19 10:12:25 +02:00
Lukas Kalbertodt
dd55a17b14 Show env key in config template 2022-10-18 16:07:51 +02:00
Lukas Kalbertodt
d03d1e0799 Add tests checking many of the standard usages of this lib 2022-10-17 17:55:30 +02:00
Lukas Kalbertodt
52cea84028 Add test for array default values 2022-10-17 12:38:05 +02:00
Lukas Kalbertodt
56f8ff24d5 Improve toml::format regarding space above nested objects 2022-04-07 17:19:38 +02:00
Lukas Kalbertodt
8db8fcafc4 Add two toml::format tests 2022-04-07 14:00:56 +02:00