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 took a look at the related PR: #158
And found the serde_seq, but didn't see how to apply it outside of a struct.
I'm just trying to serialize an index map. The project is for helping me learn rust, so I don't have a ton of experience.
Using HashMap in place of IndexMap works, other than the fact that I need keys to be in order.
It looks from the PR that you have implmented Serialize, so I don't fully understand why rust is complaining about it not being implemented. Any suggestions for yaml serialization?
error[E0277]: the trait bound `IndexMap<&str, std::option::Option<serde_json::Value>>: Serialize` is not satisfied
--> src/main.rs:107:39
|
107 | let s = serde_yaml::to_string(&version_info)?;
| ^^^^^^^^^^^^^ the trait `Serialize` is not implemented for `IndexMap<&str, std::option::Option<serde_json::Value>>`
|
::: /Users/jeffhykin/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_yaml-0.8.17/src/ser.rs:854:8
|
854 | T: ser::Serialize,
| -------------- required by this bound in `serde_yaml::to_string`
The text was updated successfully, but these errors were encountered:
Nope, I'll try that. And if there's an enable-all-features option I'll probably switch to that as well. I'll post on here once I get back into the codebase
I took a look at the related PR: #158
And found the
serde_seq
, but didn't see how to apply it outside of a struct.I'm just trying to serialize an index map. The project is for helping me learn rust, so I don't have a ton of experience.
Using HashMap in place of IndexMap works, other than the fact that I need keys to be in order.
It looks from the PR that you have implmented Serialize, so I don't fully understand why rust is complaining about it not being implemented. Any suggestions for yaml serialization?
The text was updated successfully, but these errors were encountered: