Open arennow opened 3 years ago
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;
}
@marcospb19 An owned version is already available from DirEntry::file_name()
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.
Another year later: I also came across this one after writing some code to sort directory entries and thinking about the allocations involved.
It looks like we got hung up previously on the extension trait sealing: https://github.com/rust-lang/rust/pull/83581#issuecomment-808795847
I guess we need another crater run?
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 thestd::os::unix::fs::DirEntryExt
trait.Public API
Steps / History
Unresolved Questions