We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
with dotenv = "0.15.0"
dotenv = "0.15.0"
#[derive(Deserialize)] pub struct Config { pub var: u32 }
works, but
#[derive(Deserialize)] pub struct Config { #[serde(flatten)] pub sub: Sub, } #[derive(Deserialize)] pub struct Sub { pub var: u32 }
gives an error at runtime :
Error: Custom("invalid type: string \"0\", expected u32")
The text was updated successfully, but these errors were encountered:
I'm confused, are you saying that merely having dotenv as a dependency is breaking serde?
Sorry, something went wrong.
No, I deserialize my .env file with dotenv::dotenv()?. With a flat structure it works, but using [serde(flatten)] it no longer works.
dotenv::dotenv()?
[serde(flatten)]
EDIT: Oops, I though dotenv was responsible for der variables into a struct while it's the envy crate. Sorry.
dotenv
envy
softprops/envy#26
No branches or pull requests
with
dotenv = "0.15.0"
works, but
gives an error at runtime :
The text was updated successfully, but these errors were encountered: