Skip to content

more cleanups - #69619

Merged
bors merged 4 commits into
rust-lang:masterfrom
matthiaskrgr:misc
Mar 3, 2020
Merged

more cleanups#69619
bors merged 4 commits into
rust-lang:masterfrom
matthiaskrgr:misc

Conversation

@matthiaskrgr

@matthiaskrgrmatthiaskrgr commented Mar 1, 2020

Copy link
Copy Markdown
Member
  • use starts_with() instead of chars().next() == Some(x)
  • use subsec_micros() instead of subsec_nanos() / 1000
  • use for (idx, item) in iter.enumerate() instead of manually counting loop iterations with variables
  • use values() or keys() respectively when iterating only over keys or values of maps.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @eddyb

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 1, 2020
Comment threadsrc/librustc/ty/layout.rs Outdated
Comment on lines 1385 to 1386

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer avoiding for_each as an anti-pattern, tbh, but the .values() change seems fine.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, I'll change it

Comment threadsrc/libstd/sys/unix/net.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eddybeddyb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me modulo for_each nit (I don't expect the cc's to require any changes)

@eddyb

eddyb commented Mar 2, 2020

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Mar 2, 2020

Copy link
Copy Markdown
Collaborator

📌 Commit 21affdd has been approved by eddyb

@borsbors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 2, 2020
@JohnTitorJohnTitor mentioned this pull request Mar 3, 2020
bors added a commit that referenced this pull request Mar 3, 2020
Rollup of 9 pull requests
Successful merges:
- #69213 (Improve documentation on iterators length)
- #69609 (Remove `usable_size` APIs)
- #69619 (more cleanups)
- #69620 (doc(librustc_error_codes): add long error explanation for E0719)
- #69626 (Toolstate: don't duplicate nightly tool list.)
- #69628 (Fix a leak in `DiagnosticBuilder::into_diagnostic`.)
- #69633 (Update my mailmap entry)
- #69634 (clean up E0378 explanation)
- #69637 (Don't convert Results to Options just for matching.)
Failed merges:
r? @ghost
@bors
bors merged commit f19684c into rust-lang:masterMar 3, 2020
@matthiaskrgr
matthiaskrgr deleted the misc branch January 25, 2025 09:12
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@matthiaskrgr@rust-highfive@eddyb@bors