Skip to content

breaking: use http types internally - #259

Closed
danieleades wants to merge 1 commit into
httpmock:masterfrom
danieleades:refactor/use-http-types-internally
Closed

danieleades wants to merge 1 commit into
httpmock:masterfrom
danieleades:refactor/use-http-types-internally

Conversation

@danieleades

@danieleades danieleades commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This is a breaking change.

Requests and dynamic responses now keep their http types internally. Request authorities are parsed once, and the public interface exposes borrowed typed values instead of rebuilding them from strings.

This removes redundant request accessors and response conversions. It also fixes the IPv6 authority parsing covered by #208.

This is based on #258.

Checks

  • cargo test
  • cargo test --all-features --lib
  • cargo clippy --all-targets --all-features

@codecov

codecov Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.83754% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/common/data.rs 94.80% 16 Missing ⚠️
src/common/util.rs 0.00% 6 Missing ⚠️

📢 Thoughts on this report? Let us know!

@danieleades
danieleades force-pushed the refactor/use-http-types-internally branch 3 times, most recently from de30402 to f30b5e3 Compare August 8, 2026 20:20
@danieleades
danieleades marked this pull request as ready for review August 8, 2026 20:22
@FalkWoldmann

Copy link
Copy Markdown
Member

Hi! Could you please describe how this would affect people using this crate? What do we gain from internalizing the types? Also, are all changes in this PR correlated and breaking or could it be split up into multiple PRs? Thanks!

@danieleades

Copy link
Copy Markdown
Contributor Author

Hi! Could you please describe how this would affect people using this crate? What do we gain from internalizing the types? Also, are all changes in this PR correlated and breaking or could it be split up into multiple PRs? Thanks!

it certainly could be split into separate PRs- happy to do that if useful. In fact #208 is one part of this already.

the benefit is that this crate is currently using stringly-typed fields now, and converting to and from http types during construction and every time they're accessed. by using the proper types internally the classes are correct by construction and many of the conversions go away.

there's no real benefit to consumers- it's a maintainability win

@danieleades

Copy link
Copy Markdown
Contributor Author

Split this out as requested:

I’ve closed this combined version so each change can be reviewed independently.

@danieleades danieleades closed this Aug 9, 2026
@danieleades danieleades reopened this Aug 9, 2026
@danieleades
danieleades marked this pull request as draft August 9, 2026 20:04
@danieleades

Copy link
Copy Markdown
Contributor Author

Keeping this combined PR open as a draft for reference. The split PRs are ready for review:

Each now has its own rationale, breaking-change notes, production-code estimate and focused test coverage.

@danieleades
danieleades force-pushed the refactor/use-http-types-internally branch from 75e8c6f to 55945d1 Compare August 10, 2026 10:24
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.

2 participants