You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.
I was trying to have a workaround against nested enums, and ended up with this idea of parsing a toml, but leaving parts of it that are nested as toml::Value, to be parsed (or converted with try_into()) to the enum of my choice.
I realized that an inline table enum { KeepLast = { depth = 3 }} is successfully parsed with from_str but not when it is first deserialized into a toml::Value, and then parsed.
The text Deserializer allows both uninhabited enums (represented as a TOML string) and inhabited enums (represented as a table with one element), while the Value Deserializer only allows uninhabited enums. Worth opening an issue about, imo.
The text was updated successfully, but these errors were encountered:
I was trying to have a workaround against nested enums, and ended up with this idea of parsing a toml, but leaving parts of it that are nested as
toml::Value
, to be parsed (or converted withtry_into()
) to the enum of my choice.I realized that an inline table enum
{ KeepLast = { depth = 3 }}
is successfully parsed withfrom_str
but not when it is first deserialized into atoml::Value
, and then parsed.https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c3ed207a481ed3cac8aca7a56458f0fa
Keener eyes then mine in the Matrix room #rust:matrix.org have chipped in as:
The text was updated successfully, but these errors were encountered: