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

remove text about slices being read-only. #56554

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@tangentstorm

tangentstorm commented Dec 6, 2018

slices can be mutable (since 1.7.0, I'm told), so this line no longer makes a good introduction.

remove text about slices being read-only.
slices can be mutable (since 1.7.0, I'm told), so this line no longer makes a good introduction.
@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 6, 2018

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @TimNN (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@jonas-schievink

This comment has been minimized.

Contributor

jonas-schievink commented Dec 6, 2018

Pretty sure you could always get a &mut T from a Vec<T>

@@ -171,7 +171,7 @@ use raw_vec::RawVec;
///
/// # Slicing
///
/// A `Vec` can be mutable. Slices, on the other hand, are read-only objects.
/// A slice is a reference to a part of the vector.

This comment has been minimized.

@TimNN

TimNN Dec 7, 2018

Contributor

(1) The new text could be easily read as "a slice is [always] a reference to a part of [a] vector". Can you think of a simple way to make it a bit clearer that slices can reference other stuff (not just vector contents) as well? If not, that's fine with me as well, and we can keep the current text.

(2) I'm not sure what the original intent was, but I think that "mutable" could have referred to "growable". Do you think it would make sense to have that distinction here?

@TimNN

This comment has been minimized.

Contributor

TimNN commented Dec 7, 2018

Thanks for the PR! This generally looks good to me, except for the potential changes I commented on above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment