Automatically figure out the env var name from the field name
vasilakisfil opened this issue · 3 comments
vasilakisfil commented
Hi,
when I have something like this:
#[derive(Envconfig)]
pub struct Config {
pub database_url: String
}
I would expect to be the same as:
#[derive(Envconfig)]
pub struct Config {
#[envconfig(from = "DATABASE_URL")]
pub database_url: String
}
Any reason why it doesn't convert that automatically ?
greyblake commented
Thanks for the idea. It must be possible to implement.
greyblake commented
@vasilakisfil FYI, I just merged PR enabling automatically deriving environment variable from field names: #34
vasilakisfil commented
perfetc thanks!