Skip to content
New issue

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

feat: Add from_body to Deserializer #399

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

LucasPickering
Copy link
Contributor

This exposes a method to create an HCL Deserializer directly from a Body. I know the from_body global fn already exists, but I specifically need a Deserializer so I can pass it to serde_path_to_error::deserialize.

I know Body already implements IntoDeserializer, but that creates a NewtypeStructDeserializer<Vec<Structure>> which doesn't seem to work for deserializing to arbitrary Deserialize types.

I didn't add any tests to this because it's so trivial. Happy to write one though if you'd prefer to have it.

@martinohmann
Copy link
Owner

That addition makes sense, thanks!

@martinohmann martinohmann merged commit 9d05b40 into martinohmann:main Jan 10, 2025
5 checks passed
@github-actions github-actions bot mentioned this pull request Dec 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants