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

Initialize a few variables directly #81105

Merged
merged 1 commit into from
Jan 18, 2021
Merged

Conversation

LingMan
Copy link
Contributor

@LingMan LingMan commented Jan 17, 2021

Currently they are declared as mut, get initialized to a default value, and
then possibly overwritten.

By initializing to the final value directly, they don't need to be mut and
it's clear that they don't get mutated elsewhere later on.

Currently they are declared as `mut`, get initialized to a default value, and
then possibly overwritten.

By initializing to the final value directly, they don't need to be `mut` and
it's clear that they don't get mutated elsewhere later on.
@rust-highfive
Copy link
Collaborator

r? @estebank

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 17, 2021
@nagisa
Copy link
Member

nagisa commented Jan 17, 2021

@bors r+ Thanks!

@bors
Copy link
Contributor

bors commented Jan 17, 2021

📌 Commit 0a74e17 has been approved by nagisa

@bors bors 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 Jan 17, 2021
@nagisa
Copy link
Member

nagisa commented Jan 17, 2021

@bors rollup

@estebank
Copy link
Contributor

r? @nagisa

:)

@rust-highfive rust-highfive assigned nagisa and unassigned estebank Jan 17, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2021
Rollup of 12 pull requests

Successful merges:

 - rust-lang#81038 (Update Clippy)
 - rust-lang#81071 (rustc_parse_format: Fix character indices in find_skips)
 - rust-lang#81100 (prevent potential bug in `encode_with_shorthand`.)
 - rust-lang#81105 (Initialize a few variables directly)
 - rust-lang#81116 (ConstProp: Copy body span instead of querying it)
 - rust-lang#81121 (Avoid logging the whole MIR body in SimplifyCfg)
 - rust-lang#81123 (Update cmp.rs)
 - rust-lang#81125 (Add track_caller to .steal())
 - rust-lang#81128 (validation test: turn some const_err back into validation failures)
 - rust-lang#81131 (Edit rustc_middle::ty::cast docs)
 - rust-lang#81142 (Replace let Some(..) = with .is_some())
 - rust-lang#81153 (Remove unused linkcheck exceptions)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b4defec into rust-lang:master Jan 18, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 18, 2021
@LingMan LingMan deleted the init_directly branch January 18, 2021 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: 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.

6 participants