Skip to content

Why is fs::Dir not Sync? #1230

@nrath-js

Description

@nrath-js

I was surprised to see that the fs::Dir type is not marked as Sync.

As far as I can tell, all methods that access the internal state require a &mut self, so I think it's fine to use this type from multiple threads without the need for another mutex (since at most one thread can hold a &mut reference).

Am I missing something?

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