pub fn path_to_string(path: PathBuf) -> String
Expand description
Converts a PathBuf
into a String
representation of the absolute path.
This function attempts to canonicalize the provided path, which resolves any symbolic links and returns an absolute path. If canonicalization fails, the original path is returned as a string.
§Arguments
path
- APathBuf
representing the file system path to be converted.
§Returns
A String
containing the absolute path if canonicalization succeeds, or the original path as a string otherwise.