Repository navigation
Extract the completion logic into a separate file - #5142
Merged
FranciscoTGouveia merged 2 commits intoOct 14, 2026
Merged
Conversation
djc
approved these changes
Oct 12, 2026
FranciscoTGouveia
force-pushed
the
refactor-completions
branch
from
October 12, 2026 10:33
b7546e8 to
8d9fbc5
Compare
rami3l
reviewed
Oct 12, 2026
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
force-pushed
the
refactor-completions
branch
from
October 13, 2026 12:11
8d9fbc5 to
1c7607e
Compare
3 tasks
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.
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 componentsub-commands.