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

feat: Set multi query parameters #519

Merged
merged 2 commits into from Nov 26, 2022
Merged

feat: Set multi query parameters #519

merged 2 commits into from Nov 26, 2022

Conversation

zu1k
Copy link
Contributor

@zu1k zu1k commented May 19, 2022

Add a query_vec function for setting multi query parameters. To avoid repeated deserialization and serialization.

Signed-off-by: zu1k i@zu1k.com

Signed-off-by: zu1k <i@zu1k.com>
@algesten
Copy link
Owner

Hi! Thanks for this! If we are to add this, I think the API should avoid Vec, and be:

 pub fn query_pairs(mut self, pairs: &[(&str, &str)]) -> Self {

or it could go all the way generic, but we generally have avoided "complicated" trait bounds in other contexts.

 pub fn query_pairs(mut self, pairs: impl IntoIter<(&str, &str)>) -> Self {

@jsha how do you feel about this API addition?

Signed-off-by: zu1k <i@zu1k.com>
@algesten
Copy link
Owner

I think this looks good. Unless @jsha objects, we can merge it.

@algesten algesten merged commit 614d1dd into algesten:main Nov 26, 2022
@jsha
Copy link
Collaborator

jsha commented Dec 4, 2022

Late to the party, but his looks great to me!

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.

None yet

3 participants