typed-path
typed-path copied to clipboard
`TypedPathBuf::parent` documentation indicates it returns `TypedPathBuf` instead of `TypedPath`
https://docs.rs/typed-path/0.10.0/src/typed_path/typed/non_utf8/pathbuf.rs.html#549
The documentation says that the parent method returns TypedPathBuf, but it actually returns a TypedPath.
Aside from the documentation mismatch, do you know if there is a way to take &TypedPathBuf and get the parent as another TypedPathBuf?
If you want another TypedPathBuf, you can convert the TypedPath to one.
path.parent().to_path_buf()
Alternatively, if you are okay mutating your existing TypedPathBuf, you can pop to get the parent.
path.pop();
// now it's the parent
Fixed documentation in https://github.com/chipsenkbeil/typed-path/commit/c1e942ebc2787264caf63e6877cca947703cc70a.