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

Unclear vector/slice comparison in section 2.12 of docs #24070

Closed
maxbrunsfeld opened this issue Apr 4, 2015 · 4 comments · Fixed by #24515
Closed

Unclear vector/slice comparison in section 2.12 of docs #24070

maxbrunsfeld opened this issue Apr 4, 2015 · 4 comments · Fixed by #24515

Comments

@maxbrunsfeld
Copy link

Thanks for creating such readable docs!

When vectors are introduced in section 2.12, an analogy is made involving slices:

Vectors are to slices what String is to &str.

But I don't think slices have been introduced yet; they're introduced later in that section:

A slice is a reference to (or "view" into) an array.

Maybe the first quote should compare vectors to arrays, rather than slices?

@steveklabnik
Copy link
Member

You're welcome!

So, one thing is that we generally assume that these are read out of order. I'm working on a new TOC that should address larger issues, but this might be an inter-issue. I'm pretty sure we talked about slices in section 1, though, do you happen to know?

@maxbrunsfeld
Copy link
Author

Yeah, I was reading the sections out of order myself; I'm talking about the ordering within this one section though. Vectors are introduced first, and explained via an analogy with slices. Then slices are introduced further down.

@steveklabnik
Copy link
Member

yes, understood. I was just wondering if this is the first place we ever talk about slices, or if they were mentioned before?

That doesn't make this bug invalid, I'm just curious.

@maxbrunsfeld
Copy link
Author

I don't think that they are. String slices are introduced in the previous section though.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Apr 17, 2015
Fixes rust-lang#24070

or rather, fixes it even though it's already been fixed: slices are before now. But the linking is nice anyway.
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 17, 2015
 Fixes rust-lang#24070

or rather, fixes it even though it's already been fixed: slices are before now. But the linking is nice anyway.
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 17, 2015
 Fixes rust-lang#24070

or rather, fixes it even though it's already been fixed: slices are before now. But the linking is nice anyway.
Manishearth added a commit to Manishearth/rust that referenced this issue Apr 17, 2015
 Fixes rust-lang#24070

or rather, fixes it even though it's already been fixed: slices are before now. But the linking is nice anyway.
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 a pull request may close this issue.

2 participants