greyblake/envconfig-rs

Automatically figure out the env var name from the field name

vasilakisfil opened this issue · 3 comments

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 ?

Thanks for the idea. It must be possible to implement.

@vasilakisfil FYI, I just merged PR enabling automatically deriving environment variable from field names: #34

perfetc thanks!