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

Pipes example is a bit misleading w.r.t. wc processing.

Open
#1,915 0 comments 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

Hello,

    // Because `stdin` does not live after the above calls, it is `drop`ed,
    // and the pipe is closed.
    //
    // This is very important, otherwise `wc` wouldn't start processing the
    // input we just sent.

the second part of the comment is a bit misleading since from the time we start wc, it processes data immediately. We need to close the pipe in order
to actually enforce wc to know its end of its business hence printing the sums to the output.

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

Find the Pipes example containing the quoted comment and read the surrounding explanation of stdin and wc. Revise the wording so it distinguishes wc processing incoming data from closing the pipe to signal end-of-input, then verify that the example's explanation is accurate and unambiguous.

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
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.