Skip to content
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

Bunch of nitpicks #14728

Merged
merged 12 commits into from Dec 25, 2016
Merged

Bunch of nitpicks #14728

merged 12 commits into from Dec 25, 2016

Conversation

@emilio
Copy link
Member

emilio commented Dec 25, 2016

I just noticed one while writing #14719, and then grepped and couldn't stop.

r? @nox


This change is Reviewable

@highfive
Copy link

highfive commented Dec 25, 2016

Heads up! This PR modifies the following files:

  • @bholley: components/style/thread_state.rs
  • @fitzgen: components/profile/time.rs, components/script/dom/eventdispatcher.rs, components/script/dom/element.rs, components/script/dom/node.rs, components/script/script_thread.rs, components/script/dom/domimplementation.rs
  • @KiChjang: components/script/dom/eventdispatcher.rs, components/script/dom/element.rs, components/net_traits/lib.rs, components/net_traits/lib.rs, components/script/dom/node.rs, components/script/script_thread.rs, components/script/dom/domimplementation.rs
@highfive
Copy link

highfive commented Dec 25, 2016

warning Warning warning

  • These commits modify style, layout, gfx, and script code, but no tests are modified. Please consider adding a test!
Copy link
Member

wafflespeanut left a comment

Looks easy enough 😄

r=me after addressing the comments.

None => self.headers = Some(Serde(Headers::new())),
Some(_) => (),
if self.headers.is_none() {
self.headers = Some(Serde(Headers::new()))

This comment has been minimized.

Copy link
@wafflespeanut

wafflespeanut Dec 25, 2016

Member

I've always used this, but I'm not sure whether we should prefer self.headers = self.headers.or(Some(Serde(Headers::new()))) over this.

This comment has been minimized.

Copy link
@wafflespeanut

wafflespeanut Dec 25, 2016

Member

Nit: Trailing semicolon here?

This comment has been minimized.

Copy link
@emilio

emilio Dec 25, 2016

Author Member

Looks more straight-forward and easy to read this way IMO.

}

self.buckets.insert(k, vec!(t));
self.buckets.entry(k).or_insert_with(Vec::new).push(t)

This comment has been minimized.

Copy link
@wafflespeanut

wafflespeanut Dec 25, 2016

Member

Nice! (semicolon please?)

This comment has been minimized.

Copy link
@emilio

emilio Dec 25, 2016

Author Member

Sure, if you feel strong about it... I don't personally, but fine

This comment has been minimized.

Copy link
@wafflespeanut

wafflespeanut Dec 25, 2016

Member

I don't really have an argument. Even though rustc doesn't care about these cases, I thought we should terminate expressions with semicolons, and leave it as optional for keywords. I'll better leave this to you :)

Some((size, size_type)) => resizes.push((id, size, size_type)),
None => ()
if let Some((size, size_type)) = document.window().steal_resize_event() {
resizes.push((id, size, size_type))

This comment has been minimized.

Copy link
@wafflespeanut

wafflespeanut Dec 25, 2016

Member

Nit: Trailing semicolon?

This comment has been minimized.

Copy link
@emilio

emilio Dec 25, 2016

Author Member

Same reply as above.

emilio added 12 commits Dec 25, 2016
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
That's a silly exponential algorithm btw.
@emilio emilio force-pushed the emilio:nit branch from dcffa07 to f10e376 Dec 25, 2016
@emilio
Copy link
Member Author

emilio commented Dec 25, 2016

Addressed review comments, thanks for the review @wafflespeanut!

@bors-servo r=Wafflespeanut

@bors-servo
Copy link
Contributor

bors-servo commented Dec 25, 2016

📌 Commit f10e376 has been approved by Wafflespeanut

@bors-servo
Copy link
Contributor

bors-servo commented Dec 25, 2016

Testing commit f10e376 with merge 7fc9047...

bors-servo added a commit that referenced this pull request Dec 25, 2016
Bunch of nitpicks

I just noticed one while writing #14719, and then grepped and couldn't stop.

r? @nox

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14728)
<!-- Reviewable:end -->
@bors-servo bors-servo merged commit f10e376 into servo:master Dec 25, 2016
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@emilio emilio deleted the emilio:nit branch Dec 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.