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!
Since
Pathisn'tShow, it can't be used. This would be useful, for when you're actually comparing some container ofPath, such asOption<Path>orVec<Path>.As an alternative, I tried
.map(|p| p.display())on both sides, butDisplaydoesn't implPartialEq, so it can't be used either. That means either.as_str().unwrap(), or just give up on the nicely printed failure and use plainassert!