Rust `ends_with` and `strip_prefix` behavior differences in `Path` and `str`.
As I’m writing an ignore library, I’m having subtle bugs caused by Rust’s Path behavior.
ends_within Path is different fromends_withofstrIf you try to check whether thePathis a directory by the final character, you’ll see thatpath.ends_with("/")returnsfalse.Path::strip_prefixeats also the final slash. This means if you have a directory marker at the end,/Users/emre/mydir/and send it tostrip_prefix("/Users/emre"), you’ll getmydir, notmydir/.