-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add value argument to URLSearchParams's has() and delete() #29726
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. One small nit...
list.iter().any(|&(ref k, ref v)| { | ||
if let Some(value) = &value { | ||
k == &name.0 && v == &value.0 | ||
} else { | ||
k == &name.0 | ||
} | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this could be rewritten as a match statement:
match &value {
Some(value) => k == &name.0 && v == &value.0
None => k == &name.0
}
// Step 1. | ||
self.list.borrow_mut().retain(|&(ref k, _)| k != &name.0); | ||
self.list.borrow_mut().retain(|&(ref k, ref v)| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment below...
@bors-servo try=wpt-2020 |
Add value argument to URLSearchParams's has() and delete() <!-- Please describe your changes on the following line: --> My first attempt at contributing Rust code! Add the value argument to `has()` and `done()` as in [the spec](https://url.spec.whatwg.org/#dom-urlsearchparams-delete). --- <!-- 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 #29725 (GitHub issue number if applicable) <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- 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. -->
I suspect you will also need to update results for Layout 2020. |
Test results for linux-wpt-layout-2020 from try job (#4923384275): Stable unexpected results that are known to be intermittent (1)
|
☀️ Test successful - checks-github |
Okay, it should be fixed-up now |
This commit should fix servo#29725. Signed-off-by: Veronika Bušů <paricbat@email.cz>
410e0b3
to
e40ec79
Compare
@bors-servo r+ |
📌 Commit e40ec79 has been approved by |
Test results for linux-wpt-layout-2013 from try job (#4944752906): Flaky unexpected result (17)
Stable unexpected results that are known to be intermittent (13)
|
☀️ Test successful - checks-github |
My first attempt at contributing Rust code!
Add the value argument to
has()
anddone()
as in the spec../mach build -d
does not report any errors./mach test-tidy
does not report any errors