Skip to content

Get rid of ok().expect() in the docs #29506

Closed
@fhartwig

Description

@fhartwig

This discussion showed that some people are confused by the use of the .ok().expect() on Result values in the documentation. Since Result::expect is now stable, this pattern has become mostly obsolete (with the exception of Result types whose error types do not implement Debug, which shouldn't be very common).

It probably shouldn't be used in the docs any more. Probably the most important place where this should be fixed is https://github.com/rust-lang/rust/blob/6d43fef3aaf64b2e7df14ca676a3a39b723ed7f3/src/doc/trpl/guessing-game.md , which will need to be re-written a bit since the text explicitly references that pattern.

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