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?
I was surprised to see that the
fs::Dirtype is not marked asSync.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&mutreference).Am I missing something?