-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-feature-acceptedCategory: A feature request that has been accepted pending implementation.Category: A feature request that has been accepted pending implementation.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
See discussion here: #41531.
To summarize, the following should work, but currently doesn't. It's likely that implementing impl<P: AsRef<OsStr>> FromIterator<P> for PathBuf
would solve this, but I haven't tested.
use std::path::{PathBuf, Path};
fn main() {
let path = Path::new("a/b/c/d");
println!("{:?}", path.components().filter(|c| c.as_os_str() != "b").collect::<PathBuf>());
}
SamuelMarks
Metadata
Metadata
Assignees
Labels
C-feature-acceptedCategory: A feature request that has been accepted pending implementation.Category: A feature request that has been accepted pending implementation.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.