refactor: functional style for collect_option_display_aliases#382
Merged
refactor: functional style for collect_option_display_aliases#382
collect_option_display_aliases#382Conversation
Agent-Logs-Url: https://github.com/KSXGitHub/parallel-disk-usage/sessions/6ad42e54-989e-43a0-916c-84eadbb9a9b1 Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
KSXGitHub
March 28, 2026 23:32
View session
Owner
|
Eh. Existing code is fine. |
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors collect_option_display_aliases in src/usage_md.rs to use an iterator-chain approach, aligning the implementation style with the similar alias/flag rendering logic in src/man_page.rs.
Changes:
- Replaced the mutable
Vec+push/forloops with a chained iterator pipeline. - Uses
Option::into_iter()+flatten()to uniformly handle optional alias lists.
Performance Regression Reportscommit: 070a7ba There are no regressions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
collect_option_display_aliasesinsrc/usage_md.rsused a mutableVecwith imperative push loops — the same pattern that was already refactored away insrc/man_page.rs::render_option_header_flag.Side-effectful loops elsewhere in
usage_md.rs(writing toout, early-returning on error) are left as-is.