Skip to content

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

Merged
merged 1 commit into from
Aug 8, 2014
Merged

Conversation

nham
Copy link
Contributor

@nham nham commented Aug 5, 2014

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

@@ -12,8 +12,8 @@

Utilities for vector manipulation
Copy link
Member

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?

@alexcrichton
Copy link
Member

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?

@nham
Copy link
Contributor Author

nham commented Aug 6, 2014

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.

@alexcrichton
Copy link
Member

Sadly yeah, in general the term "vector" dates back to old rust, but today a "vector" implies Vec which is distinct from a "slice" which implies &[T].

@nham
Copy link
Contributor Author

nham commented Aug 6, 2014

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]`,
Copy link
Member

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.

@nham
Copy link
Contributor Author

nham commented Aug 7, 2014

@alexcrichton Doh, I didn't check whether those were even valid functions any more. I believe I've fixed everything you pointed out.

@alexcrichton
Copy link
Member

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
@nham
Copy link
Contributor Author

nham commented Aug 8, 2014

Done

bors added a commit that referenced this pull request Aug 8, 2014
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
@bors bors closed this Aug 8, 2014
@bors bors merged commit cb0aa8a into rust-lang:master Aug 8, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 8, 2024
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.

slice.rs still mentions OwnedVector
3 participants