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 Mar 25, 2024. It is now read-only.
#[derive(Serialize)]structData{a:Vec<String>}
# ---main---
let data = Data{a:vec!["row1".to_string(), "row2".to_string()]};let ser = serde_yaml::to_string(&data).unwrap();assert_eq!(ser, "a:\n- row1\n- row2\n");
produces output: "a:\n- row1\n- row2\n" as the value of ser
whereas the expected output is: "a:\n - row1\n - row2\n". Notice the 2 spaces before each vec item.
The current serialized output is improper as per yamllint linter
The text was updated successfully, but these errors were encountered:
tanavamsikrishna
changed the title
Improper indentations of serialized output of versions 0.9.*
Improper indentations in serialized output of versions 0.9.*
Aug 1, 2022
The standard seems to allow for both kinds of indentations.
My actual concern is that the 0.9.* versions serializes data differently compared to the previous versions. So this broke my build.
Does this change originate from unsafe-libyaml ?
If you are convinced about unsafe-libyaml and intend to use it in future versions, sounds OK to me.
Else it makes sense to conform to more objective criteria like passing yamllint lint tests.
edit: I see that the very underlying yaml parser library is libyaml published by yaml foundation itself.
dtolnay
changed the title
Improper indentations in serialized output of versions 0.9.*
0.9 has less indentation of block sequence items inside a map
Aug 1, 2022
This following sample code
produces output:
"a:\n- row1\n- row2\n"
as the value ofser
whereas the expected output is:
"a:\n - row1\n - row2\n"
. Notice the 2 spaces before each vec item.The current serialized output is improper as per yamllint linter
The text was updated successfully, but these errors were encountered: