Add file IO with Vec<T> example#573
Conversation
|
Thank you for this PR! I think that using ron for several rows is an interesting use case and does deserve its own example. However, I think it might be neater to actually keep one entry per row by serialising entries without line separators and with escaped strings (both can be configured in the pretty config). Then we wouldn't need a magic entry separator, though of course one would also be restricted to not use new lines when writing entries by hand. In any case, it seems like AI was involved in creating this PR. Please review all code manually again to make sure it has natural flow and that e.g. no test files from other examples are overriden. Thank you for your contribution to Ron! |
- Ensured example works under `0.10.1` and not just `0.8.x`. - Ensured that new lines added per entry handled windows/non-windows - Ensured that the example.ron file is deleted after testing
|
Thank you for your feedback! I have updated the example to remove the magic seperator. Thank you for pointing me towards configuring PrettyConfig. Now with all compact setings on, I was able to ensure one row per entry. In the development journal, AI had suggested RON, but I did not use it to create the example code or modify any files in the repository. I have reviewed the code and it looks fairly minimal. Please feel free to give any further feedback. Thank you! |
- Clarify comments and remove outdated comments about magic seperator - Rename example file generated from `example.ron` to `vec-example.ron` - Simplify `read_ron_vec_from_str`. It no longer needs to trim the string or filter out empties.
|
@LanHikari22 Once you address the CI failures, I'm happy to merge this PR |
- Fixed crate use formatting issues - Fixed ? Issues by turning File Errors into Error::Io explicitly. This only fails when passing --no-default-features flag.
|
@juntyr Hi Juniper, Apologies for the delay. All CI failures seem resolved. Thanks, |
Issue associated with this PR is #572.
CHANGELOG.md