Skip to content

Improve [..] and as_slice documentation #28359

Closed
@rseymour

Description

@rseymour

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.

//! let int_slice = &vec[..];

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions