Skip to content

Option.as_ref() possible example mistake? #104476

Closed
@remdragon

Description

@remdragon

url: https://doc.rust-lang.org/nightly/core/option/enum.Option.html

function: as_ref()

Examples:

Converts an Option<String> into an Option<usize>, preserving the original.

Perhaps I'm just confused, but shouldn't that say:

Converts an Option<String> into an Option<&str>, preserving the original.

Metadata

Metadata

Assignees

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