rust-lang / rust-lang/rust-by-example

Clarify what `word` is in the explanation of `slice`s

Open
#1,587 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Handlebars
Stars
8.1k
Forks
1.6k
PR merge metrics
No merged PRs in 30d

Description

The explanation here says

the first word is a pointer to the data, and the second word is the length of the slice

but the explanation here says

// They are of the form [starting_index..ending_index]
// starting_index is the first position in the slice

Running the example shows the second explanation to be true. The explanations should be clarified further to avoid confusion. Thoughts?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/primitives/array.md at the two linked explanations and compare the wording with the runnable slice example. Clarify what “word” refers to so it does not conflict with the explanation of starting and ending indices, then run the example to confirm the documentation is consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.