Skip to content

Inaccuracy in the documentation for Option::unwrap_or_default #100054

Closed
@moenie99

Description

@moenie99

Location

https://doc.rust-lang.org/std/option/enum.Option.html#method.unwrap_or_default

Summary

It appears that the example was wrongly adapted from Result::unwrap_or_default, however the example does not work here because parse will never return None, its returns a Result. It appears that ideally a more fitting example should be written.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions