Closed
Bug 1488007
Opened 7 years ago
Closed 7 years ago
mozversion: Fix clippy lints
Categories
(Testing :: Mozbase Rust, enhancement)
Testing
Mozbase Rust
Tracking
(firefox64 fixed)
RESOLVED
FIXED
mozilla64
| Tracking | Status | |
|---|---|---|
| firefox64 | --- | fixed |
People
(Reporter: ato, Assigned: ato)
Details
Attachments
(2 files)
|
6.92 KB,
patch
|
jgraham
:
review+
|
Details | Diff | Splinter Review |
|
9.99 KB,
patch
|
jgraham
:
review+
|
Details | Diff | Splinter Review |
Per title.
| Assignee | ||
Updated•7 years ago
|
Assignee: nobody → ato
Status: NEW → ASSIGNED
| Assignee | ||
Comment 1•7 years ago
|
||
Address clippy lint warnings in mozversion.
Attachment #9005843 -
Flags: review?(james)
| Assignee | ||
Comment 2•7 years ago
|
||
No functional changes, except applying rustfmt.
Attachment #9005844 -
Flags: review?(james)
Comment 3•7 years ago
|
||
Comment on attachment 9005844 [details] [diff] [review]
mozversion: format
Review of attachment 9005844 [details] [diff] [review]:
-----------------------------------------------------------------
::: testing/mozbase/rust/mozversion/src/lib.rs
@@ +118,5 @@
> if let Some(captures) = version_re.captures(version_string) {
> + match captures
> + .name("major")
> + .and_then(|x| u64::from_str(x.as_str()).ok())
> + {
I hadn't considered the possibility that someone might invent a style where the { sometimes goes on a new line and sometimes not. That's impressively ugly.
Attachment #9005844 -
Flags: review?(james) → review+
Updated•7 years ago
|
Attachment #9005843 -
Flags: review?(james) → review+
| Assignee | ||
Comment 4•7 years ago
|
||
(In reply to James Graham [:jgraham] from comment #3)
> ::: testing/mozbase/rust/mozversion/src/lib.rs
> @@ +118,5 @@
> > if let Some(captures) = version_re.captures(version_string) {
> > + match captures
> > + .name("major")
> > + .and_then(|x| u64::from_str(x.as_str()).ok())
> > + {
>
> I hadn't considered the possibility that someone might invent a style where
> the { sometimes goes on a new line and sometimes not. That's impressively
> ugly.
I see what you mean, but I think it happens to not give the impression
the new block is a continuation of the chained expression.
Compare for eaxmple:
> match captures
> .name("major")
> .and_then(|x| u64::from_str(x.as_str()).ok())
> {
> new_block();
> }
To:
> match captures
> .name("major")
> .and_then(|x| u64::from_str(x.as_str()).ok()) {
> new_block();
> }
However I think maybe we can avoid this altogether by splitting
this expression up. I will do that in the patch I push.
| Assignee | ||
Comment 5•7 years ago
|
||
Actually I won’t because this code is a bit complicated.
Pushed by ato@sny.no:
https://hg.mozilla.org/integration/mozilla-inbound/rev/52af3a20610d
mozversion: lint; r=jgraham
https://hg.mozilla.org/integration/mozilla-inbound/rev/66a735968247
mozversion: format; r=jgraham
Comment 7•7 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/52af3a20610d
https://hg.mozilla.org/mozilla-central/rev/66a735968247
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Updated•7 years ago
|
Target Milestone: mozilla64 → mozilla63
Updated•7 years ago
|
Target Milestone: mozilla63 → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•