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

Rename generic type parameter in Subtyping chapter #432

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

qsantos
Copy link

@qsantos qsantos commented Nov 29, 2023

Like several issues (#124, #262, #305, #339) have pointed before, the chapter “Subtyping and Variance” can easily become confusing. I have experienced that as well, and I have noticed that this was partially caused by T used both in &'a T and as the &'a T itself in &mut &'a T (thus written &mut T).

To make things clearer, this PR renames the generic type parameter of the function R, since it is intended to be a reference in the examples. &'a T stays unchanged, but R is used when &'a T itself is intended; for instance, the more generic variant of &mut &'a T is thus &mut R.

I have also slightly changed some explanations to clarify them and take into account this new naming.

`T` was used to refer both to the generic type parameter of the function
used as an example, and to the type that this generic type parameter
would be a reference to. To make things clearer, the generic type
parameter is renamed to `R`, since it is intended to be a reference in
the examples.
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.

1 participant