pub fn strip_trailing_slash(path: &Path) -> Cow<'_, Path>
Strip any trailing slashes from a non-root path. This is required in some contexts, for example for the PWD environment variable.
PWD