Closed
Bug 1487989
Opened 6 years ago
Closed 6 years ago
webdriver: Deref the matched expression instead of each variant
Categories
(Testing :: geckodriver, enhancement)
Testing
geckodriver
Tracking
(firefox64 fixed)
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: ato, Assigned: ato)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
2.04 KB,
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
When matching we can dereference the expression we match on instead of prefixing each variant with &: > match self { > &NewSessionParameters::Spec(ref x) => x.match_browser(browser_capabilities), > &NewSessionParameters::Legacy(ref x) => x.match_browser(browser_capabilities), > } Instead: > match *self { > NewSessionParameters::Spec(ref x) => x.match_browser(browser_capabilities), > NewSessionParameters::Legacy(ref x) => x.match_browser(browser_capabilities), > }
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → ato
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•6 years ago
|
||
Instead of accessing each variant using a reference, we should dereference the matched expression when possible.
Attachment #9005822 -
Flags: review?(hskupin)
Comment 2•6 years ago
|
||
Please see bug 1465381 for how it should be done. Also I think if you make your commit message that generic, please also check the remaining code of webdriver for updates. I barely believe this is the only place which needs an update.
Blocks: 1465381
Updated•6 years ago
|
Attachment #9005822 -
Flags: review?(hskupin)
Assignee | ||
Comment 3•6 years ago
|
||
Instead of accessing each variant using a reference, we should dereference the matched expression when possible.
Attachment #9005991 -
Flags: review?(hskupin)
Assignee | ||
Updated•6 years ago
|
Attachment #9005822 -
Attachment is obsolete: true
Assignee | ||
Comment 4•6 years ago
|
||
(In reply to Henrik Skupin (:whimboo) from comment #2) > Also I think if you make your commit message that generic, please > also check the remaining code of webdriver for updates. I barely > believe this is the only place which needs an update. These were the only two cases clippy complained about, and I didn’t find any other when inspecting the code by hand. But you’re welcome to have a look: https://searchfox.org/mozilla-central/search?q=%5Cs%7B4%7Dmatch%5Cs&case=false®exp=true&path=testing%2Fwebdriver%2F**%2F*.rs
Comment 5•6 years ago
|
||
Comment on attachment 9005991 [details] [diff] [review] webdriver: deref matched expressions Review of attachment 9005991 [details] [diff] [review]: ----------------------------------------------------------------- No, I think you are right and this looks fine. Thanks.
Attachment #9005991 -
Flags: review?(hskupin) → review+
Pushed by ato@sny.no: https://hg.mozilla.org/integration/mozilla-inbound/rev/5a41ca05867b webdriver: deref matched expressions; r=whimboo
Comment 7•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/5a41ca05867b
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Updated•6 years ago
|
Target Milestone: mozilla64 → mozilla63
Updated•6 years ago
|
Target Milestone: mozilla63 → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•