Skip to content

fix: remove unneeded 'Deserialize' trait bound - #206

Merged
FalkWoldmann merged 4 commits into
httpmock:masterfrom
danieleades:unused-bound
Jan 17, 2026
Merged

FalkWoldmann merged 4 commits into
httpmock:masterfrom
danieleades:unused-bound

Conversation

@danieleades

@danieleades danieleades commented Jan 6, 2026 •

Copy link
Copy Markdown
Contributor

the 'Deserialize' bound appears to simply be a mistake.

the implicit Sized bounds can be relaxed since the method accepts a reference, which is always sized.

this allows passing &str to the methods

@danieleades

Copy link
Copy Markdown
Contributor Author

needed to resolve oxidecomputer/progenitor#1261

@danieleades

Copy link
Copy Markdown
Contributor Author

@alexliesenfeld any thoughts on this one?

this is a significant blocker for me downstream

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 PR removes unnecessary trait bounds from the json_body_obj methods to improve API ergonomics. The Deserialize trait bound was incorrectly required since the methods only serialize (via serde_json::to_value), and the implicit Sized bound can be relaxed to allow unsized types like str.

Changes:

  • Removed unnecessary Deserialize trait bound and associated lifetime parameter from When::json_body_obj
  • Added ?Sized trait bound to both When::json_body_obj and Then::json_body_obj to allow references to unsized types like &str
  • Refactored Then::json_body_obj to use a where clause for consistency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@FalkWoldmann
FalkWoldmann merged commit 2b6f532 into httpmock:master Jan 17, 2026
@FalkWoldmann

Copy link
Copy Markdown
Member

lgtm, thanks! Do you need a quick release?

@danieleades

Copy link
Copy Markdown
Contributor Author

lgtm, thanks! Do you need a quick release?

That would be amazing

@danieleades
danieleades deleted the unused-bound branch January 19, 2026 09:10
@danieleades danieleades mentioned this pull request Jan 22, 2026
@danieleades

Copy link
Copy Markdown
Contributor Author

Ping @FalkWoldmann

Is it possible to get a release?

@alexliesenfeld

alexliesenfeld commented Feb 1, 2026 •

Copy link
Copy Markdown
Member

Hi @danieleades , we are still stabilizing the next release. Once our test pipeline is green, we will ship the next release.

@danieleades

Copy link
Copy Markdown
Contributor Author

Hi @danieleades , we are still stabilizing the next release. Once our test pipeline is green, we will ship the next release.

Anything I can do to help?

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.

4 participants