-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Fix vector/array/slice terminology in manual. #16825
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
Conversation
definite-sized vector contents into a distinct vector of indefinite size. | ||
* `Vec<T>`, a 'vector' | ||
* [T ..N], an 'array' | ||
* &[T], a 'slice.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you include arrays and slices in backticks (just for readability).
I'm not sure how much precedent we have in the manual for this, but you may want to explicitly point out that Vec<T>
is not part of the language, only arrays and slices are. As a user of rust I should be aware of all three, but as a theoretical compiler implementer there's only two
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the risk of a horrible bikeshed, shouldn't the .
not be in the quotes (i.e. 'slice'.
) since the quotes are essentially defining the technical term.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how much precedent we have in the manual for this
I guess we need to work out if the manual is purely language manual/"specification", or if it is designed to include the libraries too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree they should be in backticks.
And yeah, it's an open question about language vs libraries. right now, it includes a lot of library stuff, so I think this still belongs here for now.
Thanks @steveklabnik! Out with cruft, in with the new! |
24fcc5f
to
3de1f2e
Compare
Updated! |
An example of a vector type and its use: | ||
A vector is a heap-allocated list of `T`. A vector has ownership over the data | ||
inside of it. It is also able to grow and change in size. It's important to note | ||
that `Vec<T>` is a library type, it's not actulaly part of the core language. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actualaly
Thanks! r=me with one typo |
3de1f2e
to
de82434
Compare
Whoops! Typo fixed. |
de82434
to
a021330
Compare
This has been updated. r? |
fixes #16015