Skip to content
Permalink
Browse files

Set query to None when no search params

  • Loading branch information...
CYBAI committed Jan 8, 2019
1 parent 2e15cf0 commit ae965d6d8d5c56b96132bcb40f92ef6a2c0bde42
@@ -57,10 +57,15 @@ impl URL {

pub fn set_query_pairs(&self, pairs: &[(String, String)]) {
let mut url = self.url.borrow_mut();
url.as_mut_url()
.query_pairs_mut()
.clear()
.extend_pairs(pairs);

if pairs.is_empty() {
url.as_mut_url().set_query(None);
} else {
url.as_mut_url()
.query_pairs_mut()
.clear()
.extend_pairs(pairs);
}
}
}

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

0 comments on commit ae965d6

Please sign in to comment.
You can’t perform that action at this time.