Skip to content

Default implementation on std::iter::Fuse should not requires Default on the inner iterator #140961

Open
@ultimaweapon

Description

@ultimaweapon

So it can be constructed in the following code:

let items = match std::fs::read_dir(&path) {
    Ok(v) => v.fuse(),
    Err(e) if e.kind() == ErrorKind::NotFound => Default::default(), // This line won't compile.
    Err(e) => return Err(e),
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-iteratorsArea: IteratorsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions