Skip to content

Rust Book Guessing Game Refers To Incorrect Option Type #22905

Closed
@trishume

Description

@trishume

The guessing game section of the Rust book has the line:

let input_num: Result<u32, _> = input.parse();

but multiple places nearby refer to unwrapping it with .ok() to produce an Option, which is never actually done in the code examples. It seems someone updated the code to directly use the Result<u32,_> and didn't update the surrounding text and the type error message.

This should be an easy fix but at the moment I'm a Rust newbie and I don't have a rust compiler to determine the correct type and error message.

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