# Allow std::fs::DirEntry to vend borrows of its filename

**URL:** <https://internals.rust-lang.org/t/allow-std-direntry-to-vend-borrows-of-its-filename/14328>\
**Category:** libs\
**Created:** [March 24, 2021, 2:31am UTC](https://internals.rust-lang.org/t/allow-std-direntry-to-vend-borrows-of-its-filename/14328 "2021-03-24T02:31:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![arennow](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/arennow/32/7919_2.png) [@arennow](https://internals.rust-lang.org/u/arennow)\
**Post date:** [March 24, 2021, 11:31am UTC](https://internals.rust-lang.org/t/allow-std-direntry-to-vend-borrows-of-its-filename/14328/4 "2021-03-24T11:31:18Z")

</div>

_Oh Windows…_

Yeah, I'm definitely not advocating to change `OsString` or `OsStr`. Can I ask why the idea of vending a `Cow` from the platform-neutral API seems to have not been as compelling as I was thinking? That seemed, to me, to be a good solution to the problem. Am I misunderstanding why/when to use `Cow`?

In any case, is this something that would make sense to try to PR into the standard library? I've read a bit of the contribution guide, and it seems fairly doable.

---

_[View the full topic](https://internals.rust-lang.org/t/allow-std-direntry-to-vend-borrows-of-its-filename/14328)._
