Skip to content

std::io::fs::Directories constructor #21653

@ArtemGr

Description

@ArtemGr

A user should be able to construct std::io::fs::Directories in user code in order to extend the filesystem APIs. Right now std::io::fs::Directories has private fields and I don't see a constructor.

For example, I want to make a version of walk_dir which never returns a error, returning an empty Directories instead, in order to be able to write

  if last_modified (fail_free_walk_dir (...) .filter (...)) > last_modified (fail_free_walk_dir (...) .filter (...)) {...}

Curently I can't do that without moving the contents of the Directories into a temporary vector or making a new Iterator implementation, because Directories doesn't have a public constructor.

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