Conversation
Original issue requesting this feature: rust-lang#30259 Originally implemented in rust-lang#30623 but that pull request when stale. It was rebased in rust-lang#31231, but the `Path` changes got lost as the focus shifted towards `OsString` and `OsStr`. An RFC (rust-lang/rfcs#1497) was briefly opened, since I didn't know if this functionality needed an RFC, but @alexcrichton clarified in the RFC issue I linked that this is not the case.
f8af555 to
82163fe
Compare
|
Thanks @frewsxcv! Most operations on I'm not entirely sure what the use case is for this function, but seems fine to add for symmetry? |
|
cc @aturon |
|
If this does get approved, it might also make sense to add let _ = some_path.as_os_str().len();
let _ = some_path.as_os_str().is_empty(); |
|
We discusssed this in the libs team meeting yesterday, and the conclusion was that we probably don't want Put another way, testing whether a path is empty by looking at the length of the underlying bytes is probably "just the wrong question to ask", and instead the Thanks for the PR though @frewsxcv! |
|
For anyone who came across this: path.components().next().is_none() |
Original issue requesting this feature:
#30259
Originally implemented in #30623
but that pull request when stale.
It was rebased in #31231, but the
Pathchanges got lost as the focus shifted towardsOsStringandOsStr.An RFC (rust-lang/rfcs#1497) was briefly
opened, since I didn't know if this functionality needed an RFC, but
@alexcrichton clarified in the RFC issue I linked that this is not the
case.