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

Use HeaderValue::from_static instead of a Lazy #50

Merged
merged 1 commit into from
Mar 9, 2025

Conversation

nothingmuch
Copy link
Collaborator

This does not remove the once_cell dependency since it's still used in tests, but does relegate it to a dev dependency.

With the gateway probing, I think GatewayUri might be able to have a const fn from_static, addressing the last remaining Lazy, but I haven't tried yet so I'm not sure if that'll actually work. That said, if removing the dep is desirable then the test can just be modified.

@nothingmuch nothingmuch force-pushed the from_static-instead-of-lazy branch from 8344b61 to 4c39d10 Compare March 7, 2025 14:46
@nothingmuch nothingmuch marked this pull request as draft March 7, 2025 14:48
@nothingmuch
Copy link
Collaborator Author

MSRV test failure appears to be related to #43, the GH CI script tries to update specific crates, and the update of the time crate specifically is failing (perhaps the version was yanked, not sure).

Since this was a small cleanup I was trying to do independently of other changes I'm preparing for PRs right now, I will return to it after that's done, converting to draft for now.

@nothingmuch nothingmuch force-pushed the from_static-instead-of-lazy branch 2 times, most recently from 4c39d10 to 0d372e5 Compare March 8, 2025 01:18
This does not remove the `once_cell` dependency since it's still used in
tests, but does relegate it to a dev dependency.
@nothingmuch nothingmuch force-pushed the from_static-instead-of-lazy branch from 0d372e5 to 5168510 Compare March 8, 2025 01:43
@nothingmuch nothingmuch marked this pull request as ready for review March 8, 2025 01:59
Copy link
Collaborator

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

ACK 5168510

With the gateway probing, I think GatewayUri might be able to have a const fn from_static, addressing the last remaining Lazy, but I haven't tried yet so I'm not sure if that'll actually work

#53 suggests it will not because http::Uri::from_static is not const.

@nothingmuch nothingmuch merged commit ecb66de into payjoin:main Mar 9, 2025
5 checks passed
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