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
I'm a new user of serde (as rust as a whole), and based on looking at the Overview page in the documentation, it seemed that all I needed was to include serde as a dependency and copy the example code in the page.
Much to my dismay, that was not the case.
Hidden in the "Derive" section, it explains that to actually get the example code in "Overview" to work, I need to choose the feature "derive".
This is quite an unintuitive way to write the documentation, and based on issue #1586 and this other question[1] it seems like I'm not the only one confused.
My suggestion is that the overview page should mention requiring the feature for the example code to work, perhaps with the following addition to the preceeding paragraph (emphasis mine):
Out of the box, Serde is able to serialize and deserialize common Rust data types in any of the above formats. For example String, &str, usize, Vec, HashMap<K,V> are all supported. In addition, if the derive feature is requested (see: Derive), Serde provides a derive macro to generate serialization implementations for structs in your own program. Using the derive macro goes like this:
I'm a new user of serde (as rust as a whole), and based on looking at the Overview page in the documentation, it seemed that all I needed was to include serde as a dependency and copy the example code in the page.
Much to my dismay, that was not the case.
Hidden in the "Derive" section, it explains that to actually get the example code in "Overview" to work, I need to choose the feature "derive".
This is quite an unintuitive way to write the documentation, and based on issue #1586 and this other question[1] it seems like I'm not the only one confused.
My suggestion is that the overview page should mention requiring the feature for the example code to work, perhaps with the following addition to the preceeding paragraph (emphasis mine):
[1] https://users.rust-lang.org/t/serde-cannot-find-derive-macro-deserialize-serialize-in-this-scope/79402
The text was updated successfully, but these errors were encountered: