cholcombe973 / block-utils

Rust utilities for working with block devices
MIT License
22 stars 17 forks source link

Big refactoring #16

Closed Apostoln closed 3 years ago

Apostoln commented 3 years ago
  1. Replace &Path with impl AsRef<Path>. It allows to pass into functions different string types without explicit conversion.
  2. Add lazy versions of public functions where it's possible. New functions return iterator over items instead of allocated vector with items. It allows to get info without unnecessary allocation. Old functions are still here for backward compatibility.
  3. Remove unnecessary temporary allocations in implementations.
  4. Remove unnecessary cloning
  5. Remove duplication in code, move similar parts to functions and methods
  6. Refactor code in functional style with iters and result/option methods. As for me it's more clear and concise.
  7. Fix clippy warnings
  8. Fmt