wluma icon indicating copy to clipboard operation
wluma copied to clipboard

[Bug]: Unable to read config if top table name is specified

Open yshym opened this issue 3 years ago • 1 comments

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

yshym avatar Feb 17 '22 18:02 yshym

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...

max-baz avatar Feb 17 '22 19:02 max-baz

Finally fixed in the toml library :partying_face:

max-baz avatar Jul 31 '23 09:07 max-baz