Closed Bug 1575263 Opened 5 months ago Closed 5 months ago

Fix clippy lint issues for geckodriver

Categories

(Testing :: geckodriver, task, P2)

Version 3
task

Tracking

(firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jgraham, Assigned: dheiberg)

Details

Attachments

(9 files, 1 obsolete file)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

Install clippy like:

rustup component add clippy --toolchain stable-x86_64-unknown-linux-gnu

(although on mac it's probably a different toolchain; look at the error message from cargo clippy to find out). Then run cargo clippy in testing/geckodriver. I think this ends up running on all the dependencies (and maybe some other stuff in the workspace), but it should be possible to fix everything under geckodriver, webdriver and mozbase/rust.

cargo fix might be useful to automatically apply some of the
suggestions from rustc and clippy.

Priority: -- → P2

Some of the code inside of testing/geckodriver failed/raised clippy linting errors.
Here are some minor changes to fix most of the linting issues raised by clippy.

Depends on D43939

Attachment #9088799 - Attachment is obsolete: true
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/autoland/rev/edd08f5d1fc2
Removed Clone on Copy types r=jgraham
https://hg.mozilla.org/integration/autoland/rev/f23040442548
Use _else variants of ok_or, unwrap_or, etc. to lazy evaluate functions. r=jgraham
https://hg.mozilla.org/integration/autoland/rev/389d3e7d277a
Remove redundant field names r=jgraham
https://hg.mozilla.org/integration/autoland/rev/2c2e8bf45df9
Use assignment operators instead of longer form r=jgraham
https://hg.mozilla.org/integration/autoland/rev/47ce7a659a1f
Improve use of references based on Clippy suggestions r=jgraham
https://hg.mozilla.org/integration/autoland/rev/27322845983b
Lint fixes with clippy and cargo fix r=jgraham
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/autoland/rev/55378cbba628
Change to_ to into_ to suit naming convention regarding self methods r=jgraham
https://hg.mozilla.org/integration/autoland/rev/62c8064a6be0
Move closure out of if statement r=jgraham

There are still some issues in testing/geckodriver/marionette, looking into them now as part of this bug since it's part of the same dir

Attachment #9089066 - Attachment description: Bug 1575263 - Remove redundant double Option, redundant let binding r=jgraham → Bug 1575263 - Allow clippy double option, remove redundant let binding r=jgraham
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/autoland/rev/89a456a83002
Allow clippy double option, remove redundant let binding r=jgraham

This is not a complaint, but I don’t entirely understand why this was uplifted to beta?

(In reply to Andreas Tolfsen 「:ato」 from comment #19)

This is not a complaint, but I don’t entirely understand why this was uplifted to beta?

That was just a sync between Nightly 70 and Beta 70, which happened several times between the first merge from central to beta, and the final version bump on central to 71. It's used to produce the developer edition builds.

You need to log in before you can comment on or make changes to this bug.