-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whitespace change after editing when updating from 0.22.20
to 0.22.21
#787
Comments
Nothing in the changelog indicates any intentional whitespace changes. Can you create an independent reproduction case? |
Sure, here you go: use toml_edit::{DocumentMut, Table};
fn main() {
let mut document = "bookmark = 1010".parse::<DocumentMut>().unwrap();
let key: &str = "bookmark";
document.insert(key, toml_edit::array());
let table = document[key].as_array_of_tables_mut().unwrap();
let mut bookmark_table = Table::new();
bookmark_table["name"] = toml_edit::value("test.swf".to_string());
table.push(bookmark_table);
let expected: &str = "[[bookmark]]\nname = \"test.swf\"\n";
assert_eq!(expected, document.to_string());
} This passes with
|
It appears the root cause was 189697d. |
The exact change that caused this is at 189697d#r147105791 This is an interesting case. It looks like this might actually be a bug fix as we are preserving the user's original formatting in more cases. In this case its a problem for the user because they are changing from a key-value pair to a table where the decor no longer applies. |
In light of |
Just so I'm not mistaken: Does this mean that plain |
For now, I'm restoring 0.22.20's behavior, see f74124d |
Yeah, just saw that, thank you! "For now" - and how about later? |
Likely based on feedback and, at this point, through a breaking change |
Thank you for the quick fix! ^^ |
In our regular weekly dependency bump (ruffle-rs/ruffle#18048), we have a failing test, here:
https://github.com/ruffle-rs/ruffle/blob/0a9d2bae1e9abab279fe8d20e13b2ee8e19a5bc2/frontend-utils/src/bookmarks/write.rs#L118-L142
The failure is:
Could you please advise on whether this is on us to fix, it's inconsequential because it doesn't matter for the toml syntax, or perhaps a bug in
toml_edit
?The text was updated successfully, but these errors were encountered: