1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2026-01-15 17:51:07 +00:00
uutils-coreutils/src
TechHara 3ad36a49cb
cut: refactor (#4255)
refactors `cut field` logic to reduce code duplication by factoring out the common `Searcer`, which is _templatized_ on a specific `Matcher` -- `ExactMatcher` for an explicit delimiter and `WhitespaceMatcher` for white-space delimiter.

before
- code duplication in `Searcher` and `WhitespaceSearcher`
- code duplication in `cut_fields` and `cut_fields_whitespace`

after
- two versions of `Matcher`s
- one `Searcher`
- simplify `cut_fields` by delegating actual work to specific functions
2023-01-27 21:07:36 +01:00
..
bin fix some clippy warnings (#4229) 2022-12-14 15:42:07 +01:00
uu cut: refactor (#4255) 2023-01-27 21:07:36 +01:00
uucore clippy: fix warnings introduced with Rust 1.67.0 2023-01-27 17:37:56 +01:00
uucore_procs clippy: fix warnings introduced with Rust 1.67.0 2023-01-27 17:37:56 +01:00