aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/urlsearchparams.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-10-18 04:02:13 -0400
committerGitHub <noreply@github.com>2019-10-18 04:02:13 -0400
commit32eb858a6a0534d8acdd5184a50a22d90c18b2a8 (patch)
tree663535559aa69999a1c617f2ef963c8781ae2510 /components/script/dom/urlsearchparams.rs
parent578d9a7fb9beb7c035be589f2d01b56462964829 (diff)
parente905a4606a089055be0f87afb62c1f4ccf2961c3 (diff)
downloadservo-32eb858a6a0534d8acdd5184a50a22d90c18b2a8.tar.gz
servo-32eb858a6a0534d8acdd5184a50a22d90c18b2a8.zip
Auto merge of #24469 - saschanaz:urp-default, r=Manishearth
Support USVString as default value of a union argument <!-- Please describe your changes on the following line: --> I don't expect this fixes any test though... --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #22543 <!-- Either: --> - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'components/script/dom/urlsearchparams.rs')
-rw-r--r--components/script/dom/urlsearchparams.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/components/script/dom/urlsearchparams.rs b/components/script/dom/urlsearchparams.rs
index 57c86898482..3664d30d1f7 100644
--- a/components/script/dom/urlsearchparams.rs
+++ b/components/script/dom/urlsearchparams.rs
@@ -47,12 +47,12 @@ impl URLSearchParams {
// https://url.spec.whatwg.org/#dom-urlsearchparams-urlsearchparams
pub fn Constructor(
global: &GlobalScope,
- init: Option<USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString>,
+ init: USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString,
) -> Fallible<DomRoot<URLSearchParams>> {
// Step 1.
let query = URLSearchParams::new(global, None);
match init {
- Some(USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString::USVStringSequenceSequence(init)) => {
+ USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString::USVStringSequenceSequence(init) => {
// Step 2.
// Step 2-1.
@@ -64,12 +64,12 @@ impl URLSearchParams {
*query.list.borrow_mut() =
init.iter().map(|pair| (pair[0].to_string(), pair[1].to_string())).collect::<Vec<_>>();
},
- Some(USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString::USVStringUSVStringRecord(init)) => {
+ USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString::USVStringUSVStringRecord(init) => {
// Step 3.
*query.list.borrow_mut() =
(*init).iter().map(|(name, value)| (name.to_string(), value.to_string())).collect::<Vec<_>>();
},
- Some(USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString::USVString(init)) => {
+ USVStringSequenceSequenceOrUSVStringUSVStringRecordOrUSVString::USVString(init) => {
// Step 4.
let init_bytes = match init.0.chars().next() {
Some(first_char) if first_char == '?' => {
@@ -82,8 +82,7 @@ impl URLSearchParams {
*query.list.borrow_mut() =
form_urlencoded::parse(init_bytes).into_owned().collect();
- },
- None => {},
+ }
}
// Step 5.