Skip to content

style: remove unused imports - #210

Merged
FalkWoldmann merged 2 commits into
httpmock:masterfrom
danieleades:unused-imports
Jul 5, 2026
Merged

FalkWoldmann merged 2 commits into
httpmock:masterfrom
danieleades:unused-imports

Conversation

@danieleades

@danieleades danieleades commented Jan 15, 2026 •

Copy link
Copy Markdown
Contributor

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/server/server.rs Resolved
@danieleades
danieleades force-pushed the unused-imports branch 2 times, most recently from f44f2bc to d5ddf7f Compare January 21, 2026 17:47
@FalkWoldmann
FalkWoldmann merged commit 2941e97 into httpmock:master Jul 5, 2026
1 check passed
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
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