toml
toml copied to clipboard
What should I do if I just want to parse the value
For example the following code I just want to parse the hashmap:
let v:HashMap<String, String> = toml::from_str(r#"{biz= "b1", type= "t1"}")
Whats the use case for parsing a specific data type from within the toml spec?
Supporting something like this would require a specific way to opt-in as it would be an invalid toml document and compliance requires we error on a case like this.
toml_edit
uses more specific types and we could implement FromStr
for them as a way to opt-in.
main
supports the following
-
string.parse::<toml_edit::Value>()
-
string.parse::<toml_edit::de::ValueDeserializer>()
- toml::ValueDeserializer::new(string)`
As this seems to now be covered, I'm closing this out. If there is something I missed, let me know and we can re-open.