mlange-42 / yarner

Literate Programming command line tool for Markdown
https://mlange-42.github.io/yarner
MIT License
32 stars 1 forks source link

Simplify config module #54

Closed adamreichold closed 3 years ago

adamreichold commented 3 years ago

A lot of changes but all are purely clean up without any behavior modifications, except for removing the ERROR and --> prefixes from the program output and standardizing on "ERROR" in the main handler.

Note that as a general recommendation, Option<&Borrowed> is preferable to &Option<Onwed> as a function parameter. One could always go from the latter to the former via .as_deref(), but the other way around requires a temporary allocation.

Also note that I did not try to avoid cloning config.paths so much because of the allocations, but rather to avoid having to places in the program state where the same information is stored as this allows one to introduce bugs by modifying one but reading from the other.