Closed
Description
The fact that PathBuf
is internally an OsStr
is currently noted as an implementation detail in comments. However, a number of methods clearly indicate (in documentation) that it is stored as such, and one PathBuf::into_os_str()
implicitly requires it, as it would be inefficient to do it otherwise.
Would it make sense to add #[repr(transparent)]
to PathBuf
to externally stabilize this guarantee? It would also allow me (as the maintainer of the standback crate) to use transmute
in a guaranteed manner.