style: qualify anyhow::Result<> everywhere - #5052
Merged
rami3l merged 2 commits intoSep 4, 2026
Merged
Conversation
rami3l
force-pushed
the
copilot/remove-anyhow-result-imports-again
branch
from
September 3, 2026 21:45
469f461 to
55ec79d
Compare
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are mechanical and consistent with the stated goal, with only a small localized cleanup suggestion noted in review comments.
Pull request overview
This PR performs a repo-wide style refactor to consistently spell result types as anyhow::Result<...> (rather than importing anyhow::Result as Result), aligning error-return signatures across modules and tests.
Changes:
- Removes
use anyhow::Result(and{..., Result, ...}) imports and updates function/trait signatures toanyhow::Result<...>. - Updates a handful of
collect::<Result<_>>()/collect::<Result<Vec<_>>>()call sites to the fully-qualifiedcollect::<anyhow::Result<_>>(). - Includes a small formatting modernization in a test helper (
format!("\\x{byte:02x}")).
File summaries
| File | Description |
|---|---|
| tests/suite/static_roots.rs | Updates a formatting call while keeping the test helper’s anyhow::Result signature qualified. |
| src/utils/mod.rs | Converts many utility function signatures to anyhow::Result<...> and drops the Result import. |
| src/test.rs | Updates test-only helper signatures/closures to use anyhow::Result. |
| src/settings.rs | Updates settings read/write/parse helpers to return anyhow::Result. |
| src/process.rs | Updates environment/path helper APIs to use qualified anyhow::Result types. |
| src/lib.rs | Updates a public helper API to return anyhow::Result. |
| src/install.rs | Updates install/uninstall helpers to return anyhow::Result. |
| src/fallback_settings.rs | Updates unix-only fallback settings constructor to return anyhow::Result. |
| src/dist/temp.rs | Updates temp context APIs to return anyhow::Result and removes Result re-export. |
| src/dist/mod.rs | Updates parsing/resolve helpers and internal APIs to return anyhow::Result. |
| src/dist/manifestation/tests.rs | Updates test helpers to use anyhow::Result and drops Result import. |
| src/dist/manifestation.rs | Updates installation/stream types and helpers to use qualified anyhow::Result. |
| src/dist/manifest.rs | Updates manifest parsing/validation APIs and serde helpers to use anyhow::Result. |
| src/dist/download.rs | Updates download/hashing APIs to use qualified anyhow::Result. |
| src/dist/config.rs | Updates dist config parse/stringify APIs to use anyhow::Result. |
| src/dist/component/transaction.rs | Updates transaction APIs to return anyhow::Result and drops Result import. |
| src/dist/component/package.rs | Updates package/unpack helpers to use qualified anyhow::Result. |
| src/dist/component/components.rs | Updates component management APIs/builders to return anyhow::Result. |
| src/diskio/test.rs | Updates test helpers to return anyhow::Result. |
| src/diskio/mod.rs | Updates disk I/O creation helpers to return anyhow::Result. |
| src/config.rs | Updates configuration APIs and internal helper results to qualified anyhow::Result. |
| src/command.rs | Updates command runner signature to return anyhow::Result. |
| src/cli/topical_doc.rs | Updates docs path search helpers to return anyhow::Result. |
| src/cli/setup_mode.rs | Updates setup-mode entrypoint signature to return anyhow::Result. |
| src/cli/self_update/windows.rs | Updates Windows self-update helpers to return anyhow::Result. |
| src/cli/self_update/unix.rs | Updates Unix self-update helpers to return anyhow::Result. |
| src/cli/self_update/shell.rs | Updates shell script helpers/trait methods to return anyhow::Result. |
| src/cli/self_update.rs | Updates self-update flow APIs to return qualified anyhow::Result. |
| src/cli/rustup_mode.rs | Updates CLI command handlers and a few collect sites to use anyhow::Result. |
| src/cli/proxy_mode.rs | Updates proxy-mode entrypoint signature to return anyhow::Result. |
| src/cli/docs.rs | Updates docs subcommand and server helpers to return anyhow::Result. |
| src/cli/common.rs | Updates common CLI helpers and collect site to use qualified anyhow::Result. |
| src/bin/rustup-init.rs | Updates rustup-init entrypoint and async runners to return anyhow::Result. |
Review details
- Files reviewed: 23/33 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
rami3l
force-pushed
the
copilot/remove-anyhow-result-imports-again
branch
from
September 4, 2026 08:32
8a5547a to
072b7c9
Compare
rami3l
marked this pull request as ready for review
September 4, 2026 10:03
djc
approved these changes
Sep 4, 2026
This was referenced Sep 4, 2026
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.
Note
This PR is generated with GitHub Copilot on GPT 5.6 Luna, with manual review and minor modifications.
As suggested in #5042 (comment), this patch qualifies all uses of
anyhow::Result<>across the repo.