-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Improve [..] and as_slice documentation #28359
Comments
cc #22786 I completely agree that this is a bit weird right now. I'd like to add something, but I'm not sure what form it should take. |
It doesn't seem like |
In general, |
Ah. That explains it. So it seems like |
They do the same thing. The syntax was added later, one of the motivations was that |
👍 to this, it's totally ungoogleable, from the reference I concluded it's an use of the range operator, the book section could mention it. |
Fixes rust-lang#28359 I'm not doing more here because it's unclear that `as_slice()` is even going to stick around, see rust-lang#27729
The section of the Rust book on Slices is nice (hard to find in primitive types) but it gives more information on [..](and it's origins in [1..] and [3..5] [..3] type indexing):
https://github.com/rust-lang/rust/blob/master/src/doc/trpl/primitive-types.md#slices
The actual docs for slice just intro it out of nowhere with no explanation of the fact that it's syntactic sugar for as_slice.
rust/src/libcollections/slice.rs
Line 19 in 9165a4e
This is a subtle thing, but since googling for [..] is hard and github searching for "[..]" is basically impossible, it's a tough thing to have to search out, let alone explain on the web.
Thanks! Anyway, great documentation, hard to search for without single page, but I would want to fix the docs in libcollections if possible since ideally it would have more information and detail there.
-Rich
The text was updated successfully, but these errors were encountered: