Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fs: update cfg attr in fs::read_dir #5806

Merged
merged 1 commit into from
Jun 25, 2023
Merged

fs: update cfg attr in fs::read_dir #5806

merged 1 commit into from
Jun 25, 2023

Conversation

icedrocket
Copy link
Contributor

@icedrocket icedrocket commented Jun 20, 2023

This change updates the cfg attribute to prevent unnecessary file metadata fetching on new targets.

The current DirEntry::file_type implementation returns a pre-parsed value from fs::read_dir for most targets. Some Unix operating systems are excluded because of the overhead of fetching metadata to get the file type. However, as the Rust compiler has been updated, new targets have been added and an update is needed. The cfg attribute is taken from the std implementation.

Related Issue: #5804

@Darksonn Darksonn added A-tokio Area: The main tokio crate M-fs Module: tokio/fs labels Jun 25, 2023
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@Darksonn Darksonn merged commit 6d25a00 into tokio-rs:master Jun 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-fs Module: tokio/fs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants