wluma
wluma copied to clipboard
[Bug]: Unable to read config if top table name is specified
Steps for reproducing the issue
Add [als] on top of [als.iio] in config.toml:
[als]
[als.iio]
path = "/sys/bus/iio/devices"
thresholds = { 0 = "night", 20 = "dark", 80 = "dim", 250 = "normal", 500 = "bright", 800 = "outdoors" }
What is the buggy behavior?
Application failed to read the config file
What is the expected behavior?
Application should read the config file without any issues (see toml example)
Logs
thread 'main' panicked at 'Unable to load config: expected to be able to determine enum type, found no values for key `als` at line 6 column 1', src/main.rs:25:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Version
4.1.0
Environment
No LSB modules are available.
Distributor ID: NixOS
Description: NixOS 21.11 (Porcupine)
Release: 21.11
Codename: porcupine
Linux fl 5.15.12 #1-NixOS SMP Wed Dec 29 11:29:03 UTC 2021 x86_64 GNU/Linux
1670 sway
1703 swaybg
1712 swayidle
Thanks, I confirm. Unfortunately seems to be a limitation of the TOML parsing library that we use, as it's crashing on toml::from_str(&file_config) invocation 😕
I'm actually using a fork of the library that lets us use a condensed syntax, I'll revisit this at some point and hopefully get this issue resolved as well...
Finally fixed in the toml library :partying_face: