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

Add File::create_new convenience c'tor #6557

Closed
jplatte opened this issue May 13, 2024 · 1 comment · Fixed by #6573
Closed

Add File::create_new convenience c'tor #6557

jplatte opened this issue May 13, 2024 · 1 comment · Fixed by #6573
Labels
A-tokio Area: The main tokio crate C-feature-accepted Category: A feature request that has been accepted pending implementation. C-feature-request Category: A feature request. M-fs Module: tokio/fs

Comments

@jplatte
Copy link
Member

jplatte commented May 13, 2024

A little while ago, std introduced File::create_new as a shortcut for File::options().write(true).create_new(true).open(path).

Describe the solution you'd like
Tokio should follow suit and add the same c'tor for its File type.

Describe alternatives you've considered

Additional context
Happy to provide a PR if there are no concerns about this feature request.

@jplatte jplatte added A-tokio Area: The main tokio crate C-feature-request Category: A feature request. labels May 13, 2024
@Darksonn Darksonn added M-fs Module: tokio/fs C-feature-accepted Category: A feature request that has been accepted pending implementation. labels May 14, 2024
@Darksonn
Copy link
Contributor

Since std has stabilized this method and can no longer change it, there are no concerns with us adding it too.

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 C-feature-accepted Category: A feature request that has been accepted pending implementation. C-feature-request Category: A feature request. M-fs Module: tokio/fs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants