Change parse_env error type from Debug to impl std::error::Error

This is the more appropriate trait I think and should work well for
most real world use cases.
This commit is contained in:
Lukas Kalbertodt
2022-11-06 11:23:21 +01:00
parent 1e74330f00
commit e2dded17fa
5 changed files with 50 additions and 37 deletions

View File

@@ -156,10 +156,11 @@ fn gen_partial_mod(input: &ir::Input) -> TokenStream {
confique::internal::from_env(#key, #field)?
},
(None, Some(deserialize_with)) => quote! {
confique::internal::deserialize_from_env_with(#key, #field, #deserialize_with)?
confique::internal::from_env_with_deserializer(
#key, #field, #deserialize_with)?
},
(Some(parse_env), None) | (Some(parse_env), Some(_)) => quote! {
confique::internal::parse_from_env_with(#key, #field, #parse_env)?
(Some(parse_env), _) => quote! {
confique::internal::from_env_with_parser(#key, #field, #parse_env)?
},
}
}