Skip to content

The Rust Programming Language - 4.6 Loops issue #31334

Closed
@theroseknight

Description

@theroseknight

The following code will not build or run. The issue is that 'lines' is never defined in this section of the book.

for (linenumber, line) in lines.enumerate() {
    println!("{}: {}", linenumber, line);
}
Outputs:

0: Content of line one
1: Content of line two
2: Content of line three
3: Content of line four

Rust is my first attempt to contribute to someone else's project so if I am not using these issues correctly please let me know and I will cease adding them as I go through the book.

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