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

Tracking Issue for dir_entry_ext2 #85573

Open
1 of 4 tasks
arennow opened this issue May 22, 2021 · 3 comments
Open
1 of 4 tasks

Tracking Issue for dir_entry_ext2 #85573

arennow opened this issue May 22, 2021 · 3 comments
Labels
A-io Area: std::io, std::fs, std::net and std::path C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@arennow
Copy link
Contributor

arennow commented May 22, 2021

Feature gate: #![feature(dir_entry_ext2)]

This is a tracking issue for a new method on std::fs::DirEntry on UNIX platforms via a new sealed variant of the std::os::unix::fs::DirEntryExt trait.

Public API

#[unstable(feature = "dir_entry_ext2")]
pub trait DirEntryExt2: Sealed {
    fn file_name_ref(&self) -> &OsStr;
}

Steps / History

Unresolved Questions

  • What is an appropriate name for this new trait?
@arennow arennow added C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels May 22, 2021
@m-ou-se m-ou-se added the A-io Area: std::io, std::fs, std::net and std::path label Jul 5, 2021
@marcospb19
Copy link
Contributor

Hey, @arennow and @m-ou-se, is it possible to have an owned version of this function?

(self) -> OsString

Something like this in the trait

#[unstable(feature = "dir_entry_ext2")]
pub trait DirEntryExt2: Sealed {
    fn file_name_ref(&self) -> &OsStr;
    fn into_file_name(self) -> OsStr;
}

@tavianator
Copy link
Contributor

@marcospb19 An owned version is already available from DirEntry::file_name()

@mic006
Copy link

mic006 commented Apr 3, 2023

Hi @arennow and @m-ou-se

Is it planned to make this change stable in a coming release ?
The change seems to be a good optimization (typically for sorting DirEntry-s), without any risk of issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-io Area: std::io, std::fs, std::net and std::path C-tracking-issue Category: A tracking issue for an RFC or an unstable feature. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants