As someone else said I think the shadowing works well here.
I do also wanna mention that depending on why you need this conversion, you could use impl AsRef<std::path::Path>
for your function signature so it can accept or
. Then, just use that argument with e.g.
p.as_ref()
to get a in the function body
To be fair this is a terminal file manager… only a certain kind of person will be interested in the first place, and those people are likely to be more inclined to leave a star on GitHub.
Personally I believe the stars were achieved naturally but of course there’s no way to know and it never hurts to be skeptical.