Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Refactor config.rs to pure functional style (starship#427)
- Replaced for loop that iterates over mutable state with a fold expression - Unified the logging for the different accessors. The code is now screaming for further refactoring (get_module_config, get_as_bool, get_as_str, get_as_i64 and get_as_array are basically the same up to higher order functions but I didn't manage to get the life times right) - Increased test coverage (especially a test case for none not at the end) - Removed code comments that literally repeated the code in the next line (see e.g. https://blog.usejournal.com/stop-writing-code-comments-28fef5272752) - Added TODO for the problematic line that swallows the None and produces Some(Style::new()) (this also happened before but in a less obvious way)
- Loading branch information