Skip to content

Conversation

@dtolnay
Copy link
Contributor

@dtolnay dtolnay commented Apr 26, 2022

If I have:

triple = get_host_triple(repository_ctx)

f(triple.triple)

then triple.triple does not do a good job conveying what is going on; how the two things called triple (actually 3 if you count the function named triple as well) are different from one another.

To improve this in #1289 I added a str field to the triple struct, just duplicating the contents of the triple field but with a clearer name. In contrast to triple.triple, writing f(triple.str) is clearer to me and conveys "oh yeah f takes a string argument (as opposed to a struct) and triple.str is the string representation of the triple".

This PR removes the field triple.triple in favor of triple.str since there is no longer a reason to use the former.

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

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

Thanks for the follow-up! Looks good to me 😄

@UebelAndre UebelAndre merged commit 97de47d into bazelbuild:main Apr 26, 2022
@dtolnay dtolnay deleted the tripletriple branch April 26, 2022 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants