Repository navigation
style: remove unused imports - #210
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request removes unused imports and reorganizes import statements across the codebase using cargo +nightly fmt with specific configuration (imports_granularity=Crate,group_imports=StdExternalCrate). The changes standardize import ordering to follow the pattern: std library imports, external crate imports, then internal crate imports.
Changes:
- Removed 126 unused imports across test and source files
- Reorganized import statements into consistent groups (std -> external -> crate)
- Moved some imports to be feature-conditional or function-scoped where appropriate
Reviewed changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/utils/http.rs | Reorganized imports to separate std from external crates |
| tests/misc/runtimes_test.rs | Moved crate imports after external imports in multiple test functions |
| tests/misc/extensions_test.rs | Reordered imports to follow std -> external -> crate pattern |
| tests/matchers/*.rs | Standardized import ordering across matcher test files |
| tests/lib.rs | Separated std imports from external crate imports |
| tests/examples/*.rs | Reorganized imports and moved crate imports after external imports |
| src/server/tls.rs | Reorganized imports into std, external, and crate groups |
| src/server/state.rs | Removed unused imports and reorganized remaining ones |
| src/server/server.rs | Removed multiple unused imports but inadvertently removed hyper::upgrade::on as upgrade_on which is still used on line 216 |
| src/server/persistence.rs | Reorganized imports into standard groups |
| src/server/mod.rs | Removed unused imports and simplified import structure |
| src/server/matchers/*.rs | Standardized import organization across matcher modules |
| src/server/handler.rs | Removed unused imports and switched to fully qualified paths for some types (HeaderName) |
| src/server/builder.rs | Made some imports feature-conditional and reorganized |
| src/main.rs | Removed blank line between imports |
| src/lib.rs | Removed unused imports and reordered feature-specific exports |
| src/common/*.rs | Reorganized imports following std -> external -> crate pattern |
| src/api/*.rs | Reorganized imports and moved ToSocketAddrs to function-scoped import |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
danieleades
force-pushed
the
unused-imports
branch
2 times, most recently
from
January 21, 2026 17:47
f44f2bc to
d5ddf7f
Compare
danieleades
force-pushed
the
unused-imports
branch
from
July 5, 2026 06:08
d5ddf7f to
195d967
Compare
danieleades
force-pushed
the
unused-imports
branch
from
July 5, 2026 06:12
195d967 to
2eabc1e
Compare
danieleades
pushed a commit
to danieleades/httpmock
that referenced
this pull request
Jul 5, 2026
The https-gated code in handle_tcp_stream and serve_tls_connection referenced the IOError and TlsError variants unqualified, but after the unused-import cleanup in httpmock#210 they are no longer imported, so any build enabling https (e.g. --all-features) failed to compile. Qualify both through the in-scope Error type. Surfaced by the per-feature CI checks. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_018uYgn6Ji3viDwL99N9GCxM
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.
remove the unused imports.
addresses 126 compiler warnings (see #209)
imports sorted and formatted using
cargo +nightly fmt -- --config imports_granularity=Crate,group_imports=StdExternalCrate