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.
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.