Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid unnecessary serialize for RequestPacket. #61

Merged
merged 2 commits into from
Dec 5, 2023

Conversation

robinsdan
Copy link
Contributor

Motivation

Current implementation will serialize the request twice: Reqeust<Params> -> SerializedRequest -> hyper/reqwest request's json body.

Solution

Replace RequestPacket::serialize(&self) with RequestPacket::serialize(self), we can avoid the second serialize for hyper client.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@prestwich
Copy link
Member

CI failure is unrelated, @Evalir is fixing :)

@prestwich
Copy link
Member

can you rebase on latest main for me?

@prestwich prestwich added the enhancement New feature or request label Dec 5, 2023
@Evalir
Copy link
Contributor

Evalir commented Dec 5, 2023

@prestwich done!

Copy link
Contributor

@Evalir Evalir left a comment

Choose a reason for hiding this comment

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

ty!

@Evalir Evalir merged commit e1e0da6 into alloy-rs:main Dec 5, 2023
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants