Skip to content

std::env::SplitPaths does not document its Item type #59543

Closed
@brettcannon

Description

@brettcannon

Reading both https://doc.rust-lang.org/std/env/struct.SplitPaths.html and https://doc.rust-lang.org/std/env/fn.split_paths.html there's no specification that the Item type for the iterator is PathBuf. To me it seemed ambiguous what an "iterator that splits an environment variable into paths" or "an iterator over the paths" returns since it could be the string representing the paths -- which is OsStr -- or an actual Path object.

I'm happy to submit a PR if this is makes sense enough to fix (since according #30093 it used to specify this detail and now it doesn't with a quick perusal of https://github.com/rust-lang/rust/blame/master/src/libstd/env.rs not turning up anything obvious as to why the change).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions