Skip to content

Extract the completion logic into a separate file - #5142

Merged
FranciscoTGouveia merged 2 commits into
rust-lang:mainfrom
FranciscoTGouveia:refactor-completions
Oct 14, 2026
Merged

FranciscoTGouveia merged 2 commits into
rust-lang:mainfrom
FranciscoTGouveia:refactor-completions

Conversation

@FranciscoTGouveia

Copy link
Copy Markdown
Contributor

Instead of keeping the completion-related logic in src/cli/rustup_mode.rs, this PR moves it to a new file in the same module, src/cli/completions.rs.

Regarding tests, as they do not imply the creation of mock scenarios, they were kept in the same file.

Moreover, some strings were extracted into constants. They are used only once now, but this will help avoid repetition when we introduce completions for the rustup component sub-commands.

Comment thread src/cli/completions.rs Outdated
Comment thread src/cli/completions.rs
Although currently the `MANIFEST` constant is only used once, it is
preferable to have it extracted as it will be used in the tests of later
sub-commands' completions (e.g., `rustup component add/remove`).
@FranciscoTGouveia
FranciscoTGouveia added this pull request to the merge queue Oct 14, 2026
Merged via the queue into rust-lang:main with commit fa0650a Oct 14, 2026
29 checks passed
@FranciscoTGouveia
FranciscoTGouveia deleted the refactor-completions branch October 14, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants