Skip to content

Documentation and results do not match #4363

Open
@Jixiangup

Description

@Jixiangup
  • I have searched open and closed issues and pull requests for duplicates, using these search terms:

  • I have checked the latest main branch to see if this has already been fixed, in this file:

URL to the section(s) of the book with this problem: https://doc.rust-lang.org/book/ch17-04-streams.html#streams-futures-in-sequence

Description of the problem:
Use the code in the document:

Image

The prompt will report an error, but when I run the same code, it works fine. Please correct it.

Image
  • Rust version info
coloxan@96 example % rustc --version
rustc 1.86.0 (05f9846f8 2025-03-31)
coloxan@96 example % cargo --version
cargo 1.86.0 (adf9b6ad1 2025-02-28)

Suggested fix:

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