Closed coriolinus closed 1 year ago
If by Config.toml
you mean Cargo.toml
, then it is already parsed with the toml
crate and there is no appending: the content of the file is parsed, modified and then the new content fully overrides the old one. What should be added to this behavior in the context of this issue?
See the changes here. There are some other changes in that diff, mostly due to some necessary macro refactoring, but that file has the most important ones.
exercise util has been deleted since, see this thread for more context.
Currently many operations in this utility operate at the file level, directly appending strings and bytes. We'll get better results with higher-level abstractions: never directly appending to
Config.toml
, for example, but using a toml-parsing crate instead. Likewise, writing the tests file will be much easier using a template system likehandlebars
. Note that this mention of handlebars isn't a requirement to use that particular crate, just an example of a plausible templating engine.It is not necessary to implement this before #679 or #686, but those issues will probably be easier to fix after the fix for this has been implemented.