Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #13402 - epage:add, r=weihanglo
fix: Don't duplicate comments when editing TOML ### What does this PR try to resolve? `toml_edit` <0.22 has a bug that will cause ```toml [lints] rust.unsafe_op_in_unsafe_fn = "deny" rust.explicit_outlives_requirements = "warn" # rust.unused_crate_dependencies = "warn" clippy.cast_lossless = "warn" clippy.doc_markdown = "warn" clippy.exhaustive_enums = "warn" ``` to be written out as ```toml [lints] rust.unsafe_op_in_unsafe_fn = "deny" rust.explicit_outlives_requirements = "warn" # rust.unused_crate_dependencies = "warn" clippy.cast_lossless = "warn" # rust.unused_crate_dependencies = "warn" clippy.doc_markdown = "warn" # rust.unused_crate_dependencies = "warn" clippy.exhaustive_enums = "warn" ``` when it is parsed and then saved. See toml-rs/toml#673 This affects any format-preserving edits we do, including: - `cargo add` - `cargo remove` - `cargo init` / `cargo new` editing the workspace ### How should we test and review this PR? I didn't add any tests as this is covered by `toml_edit`s tests (we already don't cover a fraction of the edit preserving tests it has) ### Additional information
- Loading branch information