dust icon indicating copy to clipboard operation
dust copied to clipboard

Lots of code cleanup

Open Lucretiel opened this issue 3 years ago • 0 comments

  • Try to use iterator adapters and collect in various places, where possible. This especially benefits draw_it.
  • Try to use .map and other similar methods on Options and Results, where possible
  • Replaced nearly all clones with reference-based equivalents
  • Summarizing nodes by file extension is now much more efficient (significantly fewer allocations)
  • PartialOrd and PartialEq implementations on Node and DisplayNode now agree with each other (it's no longer possible to construct a Node for which node1 != node2 && !(node1 < node2) && !(node1 > node2)).
  • Replace #[cfg(...)] function definitions with simpler if cfg!(...) equivalents
    • The optimized code is the same and this reduces maintenance burden of keeping signatures synchronized
  • Simplify CLI Values handling by taking advantage of Values::default
  • Various spelling corrections in comments
  • Replace (sort, reverse) with sort_by

I can split this into several PRs if you'd like, but each change was so small that it was easier to put them all together.

Lucretiel avatar Jul 31 '22 20:07 Lucretiel