Repository navigation
refactor: remove dead code and drop the url dependency - #246
Merged
FalkWoldmann merged 1 commit intoAug 7, 2026
Merged
Conversation
Remove helpers with no callers anywhere in the crate:
- HttpMockBytes::{is_blank, contains_str, contains_slice, contains_vec}
- HttpMockRequest::{query_params_map, to_http_request}
- the dead enable_https field on HttpsConfigBuilder (only ever None,
with an unreachable validate() branch and an orphaned doc comment)
- duplicate private converters in data.rs (from_string_pair_vec,
from_pattern_vec)
Parse query strings with form_urlencoded directly instead of the
dummy-URL workaround, which removes the last use of the url crate.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Member
|
Good stuff, thanks! I guess this would warrant a 0.9 release since this is somewhat breaking, which is ok since we can use this release to clean up dubious APIs like these :D |
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.
What
Removes items with zero callers anywhere in the crate (src, tests, doc examples):
HttpMockBytes::{is_blank, contains_str, contains_slice, contains_vec}HttpMockRequest::{query_params_map, to_http_request}enable_httpsfield onHttpsConfigBuilder— it was only everNone, guarded an unreachablevalidate()branch, and had an orphaned doc comment for an enable/disable method that was never implementeddata.rs(from_string_pair_vecwas byte-for-byte identical toto_name_value_string_pair_vec;from_pattern_vecwas a needless clone)Also switches
query_params()/query_param_length()to parse the query string withform_urlencodeddirectly instead of theformat!("http://dummy?{}")+Url::parseworkaround — which removes the last use of theurlcrate, so the dependency is dropped.Semver note
HttpMockRequestis re-exported at the crate root and is passed to user-provided matcher closures, so the removedpubmethods were technically reachable downstream (e.g.req.body().contains_str(..)). Nothing in this repo uses them, but strictly this is API-trimming — flagging it so you can decide whether it should wait for a 0.9 release.Overlap note
The private-converter cleanup in
data.rsalso appears in #247; the hunks are identical, so the PRs merge cleanly in either order.Verification
Full
cargo test --all-featuressuite passes locally, including all 138 doctests (which proves no doc example referenced the removed items).