Closed
Bug 1487993
Opened 6 years ago
Closed 6 years ago
webdriver: Loop over references to containers instead of using explicit iteration methods
Categories
(Testing :: geckodriver, enhancement)
Testing
geckodriver
Tracking
(firefox64 fixed)
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: ato, Assigned: ato)
Details
Attachments
(1 file, 1 obsolete file)
5.76 KB,
patch
|
whimboo
:
review+
|
Details | Diff | Splinter Review |
Instead of x.iter() we can simply do &x.
Assignee | ||
Updated•6 years ago
|
Assignee: nobody → ato
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•6 years ago
|
||
Instead of making explicit calls to iterator protocol methods such as x.iter() or x.into_iter(), we can loop over references to collections. This is considered better style.
Attachment #9005824 -
Flags: review?(hskupin)
Comment 2•6 years ago
|
||
Comment on attachment 9005824 [details] [diff] [review] webdriver: avoid explicitly calling iteration protocols Review of attachment 9005824 [details] [diff] [review]: ----------------------------------------------------------------- ::: testing/webdriver/src/capabilities.rs @@ +189,5 @@ > ErrorStatus::InvalidArgument, > "proxy is not an object" > ); > > + for (key, value) in obj { Isn't that also possible for line 125? I also see a couple more of those things to fix.
Attachment #9005824 -
Flags: review?(hskupin)
Assignee | ||
Comment 3•6 years ago
|
||
Instead of making explicit calls to iterator protocol methods such as x.iter() or x.into_iter(), we can loop over references to collections. This is considered better style.
Attachment #9005824 -
Attachment is obsolete: true
Attachment #9005993 -
Flags: review?(hskupin)
Assignee | ||
Comment 4•6 years ago
|
||
(In reply to Henrik Skupin (:whimboo) from comment #2) > Isn't that also possible for line 125? I also see a couple more of those > things to fix. Indeed. Strange the linter didn’t complain about those… There’s one instance still left, but in that case serde doesn’t implement the Iter trait so we need to call it explicitly.
Comment 5•6 years ago
|
||
Comment on attachment 9005993 [details] [diff] [review] webdriver: avoid explicitly calling iteration protocols Review of attachment 9005993 [details] [diff] [review]: ----------------------------------------------------------------- r=wc ::: testing/webdriver/src/capabilities.rs @@ +414,5 @@ > }) > .map(|merged| merged.and_then(|x| self.validate(x, browser_capabilities))) > .collect::<WebDriverResult<Vec<Capabilities>>>()?; > > let selected = merged_capabilities Note, that there is one more instance in line 423.
Attachment #9005993 -
Flags: review?(hskupin) → review+
Pushed by ato@sny.no: https://hg.mozilla.org/integration/mozilla-inbound/rev/2ecbda656977 webdriver: avoid explicitly calling iteration protocols; r=whimboo
Comment 7•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/2ecbda656977
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
•