Skip to content

Clarify some generate variables by renaming #461

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

Merged
merged 4 commits into from
Aug 6, 2020

Conversation

couchand
Copy link
Contributor

@couchand couchand commented Aug 6, 2020

As I went to start poking around src/generate/register.rs, I got confused by a handful of variable-name-containing variable names. This is an attempt to make things a bit clearer by making the names more unique across the file and consistent with the variable names contained within.

Using an underscore prefix on the name of variable holding an
underscore-prefixed name is a cute convention, but it subverts the
expectations of programmers as well as the compiler's unused-variable
checks.

This changes such references to use the convention `u_` to indicate
an underscore-prefixed name instead.
To try to make the code-generation code easier to follow, rename a few
common variable-containing variables with more descriptive names.
Again, using an underscore prefix on a variable intended to be used
subverts compiler and programmer expectations.  In this case it's even
more misleading, as the contained variable name does not itself start
with an underscore.
Same rationale as previous changes.
@couchand couchand requested a review from a team as a code owner August 6, 2020 04:24
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ryankurte (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-tools labels Aug 6, 2020
Copy link
Contributor

@therealprof therealprof left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

bors r+

@bors bors bot merged commit 69fb8f2 into rust-embedded:master Aug 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants