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
Hey guys, I'm working on replacing toml-rs for the ability to preserve the order and comments on the file, so toml_edit looked like the perfect tool for it.
I tried to use the easy module, because i thought that it was the toml-rs api but with the toml_edit behaviour, so I wouldn't have to change much code, since the code base written with toml-rs is quite large, but it kept the toml-rs behaviour of getting rid of comments and changing the order of things.
So, what I wanted to ask you guys is if the easy module is meant to preserve comments and like the “main” library or is it supposed to work exactly as toml-rs? And if easy is tooml-rs inside toml_edit, do you guys have any advice on replacing toml-rs?
The text was updated successfully, but these errors were encountered:
Thats a good question that I overlooked in the docs and have since rectified it.
toml_edit::easy is meant for when want toml-rs and toml_edit but want either consistency in behavior or to keep your number of dependencies low. The design of toml-rs prevents us from this being format-preserving.
I will say the toml_edit API has gotten easier over time.
do you guys have any advice on replacing toml-rs?
Porting toml-rs code to toml_edit?
My first would be to only focus on doing that where its needed. If you have places where you only read TOML, feel free to keep that using toml-rs.
Beyond that,
Check your use of serde. We can't preserve formatting through that, though we could make it easier to insert chunks of new TOML data into a format-preserving Document via serde
If you are using the toml::Value API, the toml_edit::Document API won't be too different. The biggest issue will be that we have two table types, Table and InlineTable and two array types, Array and ArrayOfTables. TableLike and our Index / IndexMut APIs help gloss over some of these details.
Hey guys, I'm working on replacing toml-rs for the ability to preserve the order and comments on the file, so toml_edit looked like the perfect tool for it.
I tried to use the easy module, because i thought that it was the toml-rs api but with the toml_edit behaviour, so I wouldn't have to change much code, since the code base written with toml-rs is quite large, but it kept the toml-rs behaviour of getting rid of comments and changing the order of things.
So, what I wanted to ask you guys is if the easy module is meant to preserve comments and like the “main” library or is it supposed to work exactly as toml-rs? And if easy is tooml-rs inside toml_edit, do you guys have any advice on replacing toml-rs?
The text was updated successfully, but these errors were encountered: