tbrand / cargo-tomlfmt

Formatting Cargo.toml
https://crates.io/crates/cargo-tomlfmt
MIT License
30 stars 2 forks source link

Use toml_edit as a parser #6

Closed tbrand closed 5 years ago

tbrand commented 5 years ago

Related issue. https://github.com/tbrand/cargo-tomlfmt/issues/5

As @regexident pointed it out, cargo-tomlfmt removes all comments in Cargo.toml previously. So I switched the main parser from toml to toml_edit to preserve these comments.

This fix also resolve the #4 error as a side effect. Thanks for the suggestion @regexident! 👍