ACP: Implement PartialEq<str>
for Path
, PathBuf
and vice-versa
#151
Labels
ACP-accepted
API Change Proposal is accepted (seconded with no objections)
api-change-proposal
A proposal to add or alter unstable APIs in the standard libraries
T-libs-api
Proposal
Problem statement
When testing functions that return
PathBuf
one might want to useassert_eq!
with a string literal in tests. This is currently impossible because of lacking impls.Motivation, use-cases
For my use case, the function in question processes program arguments assuming zeroth argument is the path to the program, so it returns
PathBuf
which should be the most appropriate. In the test I mock the arguments providing a different iterator with known zeroth argument. I wish to compare them to ensure the function returns the correct value.I would be surprised if there weren't any other tested existing crates that do some path computation.
Solution sketches
I believe this is the obvious, idiomatic solution. I don't see any meaningful downsides.
Links and related work
N/A, will send a PR if this is approved.
What happens now?
This issue is part of the libs-api team API change proposal process. Once this issue is filed the libs-api team will review open proposals in its weekly meeting. You should receive feedback within a week or two.
The text was updated successfully, but these errors were encountered: