-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Cleanup collections::slice documentation. #16279
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
@@ -12,8 +12,8 @@ | |||
|
|||
Utilities for vector manipulation |
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 this also change from vector
to slice
?
In general there are a still a lot of mentions of vectors vs slices in this doc string that need to be updated. I suppose that #15459 isn't necessarily about that per se, but while you're add it would you mind updating the references to today's terminology? |
I wasn't aware that we were exclusively using "slice" these days instead of "vector"! But I agree it makes the most sense, and am happy to fix the rest of these occurrences. |
Sadly yeah, in general the term "vector" dates back to old rust, but today a "vector" implies |
I've replaced occurrences of "vector" with "slice". I've also added an explanation of the difference between mutable and immutable slices and an example for how you can mutate through a mutable slice. |
``` | ||
|
||
This is a big module, but for a high-level overview: | ||
Slices are either mutable or immutable. The immutable slice type is `&[T]`, |
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.
We've been trying to steer towards the term "shared" over "immutable" because a slice of Cell<int>
is not immutable.
@alexcrichton Doh, I didn't check whether those were even valid functions any more. I believe I've fixed everything you pointed out. |
Awesome, thanks so much! Could you squash the commits together as well? |
This does a few things: - remove references to ~[] and the OwnedVector trait, which are both obsolete - correct the docs to say that this is the slice module, not the vec module - add a sentence pointing out that vectors are distinct from Vec - remove documentation on Vec. closes rust-lang#15459
Done |
This does a few things: - remove references to ~[] and the OwnedVector trait, which are both obsolete - correct the docs to say that this is the slice module, not the vec module - add a sentence pointing out that vectors are distinct from Vec - remove documentation on Vec. closes #15459
feat: IDE features for primitive tuple fields Fixes rust-lang/rust-analyzer#13018
This does a few things:
obsolete
module
closes #15459