Skip to content

Odd result from Path::components on Windows #101358

Closed
@casey

Description

@casey

This might be a bug, or this might just be me not understanding how Windows UNC paths work.

When I call this:

Path::new("//foo//bar//").components().collect::<Vec<Component>>()

I get:

[Prefix(PrefixComponent { raw: "//foo//ba", parsed: UNC("foo", "bar") }), RootDir, Normal("r")]

This seems very odd! The bar component is truncated, and //foo/ba is the prefix, followed by a root dir, followed a normal r component.

It seems like the way this path is broken into components on Windows has changed since an old release. I have a path cleaning library, lexiclean, whose CI was passing as of April 20th. It picked up a new release between now and then, and CI is now failing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions