Skip to content

impl Display for Path #63822

Closed
Closed
@benw

Description

@benw

It's deliberate that to date Path does not impl Display. It's a conservative stance that says that because the conversion to utf8 can be lossy, there isn't necessarily one obviously correct way to display a path.

I'd like to revisit that decision, in the interests of convenience. I can't imagine that anyone does anything other than call .display() or .to_string_lossy(). The current inconvenience might tend to encourage people to use &str/String rather than &Path/Pathbuf, which I think is a worse outcome. Also, impl Display for Path does not preclude anyone from providing a different way of displaying paths should they choose to.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions