Skip to content

doc: Book uses Result::expect() but still makes reference to Option::expect() #31912

Closed
@Sgeo

Description

@Sgeo

https://doc.rust-lang.org/book/guessing-game.html contains statements like

If we leave off calling these two methods, our program will compile, but we’ll get a warning:

Luckily, if we just want to crash if there’s a problem, we can use these two little methods.

The book used to use .ok().expect(...), but has switched to .expect(...), from two methods for error handling/crashing to one.

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