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

Adjust set_query_from_pairs bounds #129

Merged
merged 1 commit into from
Sep 3, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ extern crate serde;
use std::fmt::{self, Formatter};
use std::str;
use std::path::{Path, PathBuf};
use std::borrow::Borrow;

#[cfg(feature="serde_serialization")]
use std::str::FromStr;
Expand Down Expand Up @@ -744,7 +745,8 @@ impl Url {
/// Serialize an iterator of (key, value) pairs as `application/x-www-form-urlencoded`
/// and set it as the URL’s query string.
#[inline]
pub fn set_query_from_pairs<'a, I: Iterator<Item = (&'a str, &'a str)>>(&mut self, pairs: I) {
pub fn set_query_from_pairs<I, K, V>(&mut self, pairs: I)
where I: IntoIterator, I::Item: Borrow<(K, V)>, K: AsRef<str>, V: AsRef<str> {
self.query = Some(form_urlencoded::serialize(pairs));
}

Expand Down