jplatte / serde_html_form

Rust crate for (de-)serialization of `application/x-www-form-urlencoded` data.
MIT License
23 stars 3 forks source link

Allow to deserialize to `Option<Vec>` #3

Closed thomaseizinger closed 1 year ago

thomaseizinger commented 1 year ago

Ran into this whilst trying to deserialize an optional list of choices in a web app.

jplatte commented 1 year ago

Thanks for the PR! I guess it doesn't hurt, but I recommend using #[serde(default)] value: Vec<String> instead.

thomaseizinger commented 1 year ago

Thanks for the PR! I guess it doesn't hurt, but I recommend using #[serde(default)] value: Vec<String> instead.

Hmm, I guess that is equivalent yeah. Will try!