You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use twelf::{config,Layer};#[config]structConf{}fnmain(){Conf::with_layers(&[Layer::Toml("example.toml".into())]).unwrap();}
When I run the program, I get an error:
thread 'main' panicked at src/main.rs:7:62:
called `Result::unwrap()` on an `Err` value: ShellExpand(LookupError { var_name: "FOO", cause: NotPresent })
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
It appears that variables within comments are interpolated/expanded.
This is an issue, because I would like to provide a sample config with commented settings which contain environment variables.
The text was updated successfully, but these errors were encountered:
mre
added a commit
to mre/twelf
that referenced
this issue
Feb 9, 2024
Applied the fix to all config files with comment support.
The one downside is, that I had to repeat the same code in each function. That is due to `#[proc_macro]` crate rules: according to Rust's restrictions, these crates can only export items that are procedural macros themselves.
Fixesbnjjj#37
Applied the fix to all config files with comment support.
The one downside is, that I had to repeat the same code in each function. That is due to `#[proc_macro]` crate rules: according to Rust's restrictions, these crates can only export items that are procedural macros themselves.
Fixes#37
Given the following TOML config:
# key = "${FOO}"
and this
main.rs
:When I run the program, I get an error:
It appears that variables within comments are interpolated/expanded.
This is an issue, because I would like to provide a sample config with commented settings which contain environment variables.
The text was updated successfully, but these errors were encountered: