Skip to content

assert_eq!() cannot be used on Path #15625

Closed
@o11c

Description

@o11c

Since Path isn't Show, it can't be used. This would be useful, for when you're actually comparing some container of Path, such as Option<Path> or Vec<Path>.

As an alternative, I tried .map(|p| p.display()) on both sides, but Display doesn't impl PartialEq, so it can't be used either. That means either .as_str().unwrap(), or just give up on the nicely printed failure and use plain assert!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions