pub fn plain(path: &Path) -> Result<Cow<'_, Path>, HomeDirNotFound> {
    if path.starts_with("~") {
        // Replace `~` with user's home directory.
        dirs::home_dir()
            .map(|mut path_normalized| {
                path_normalized.extend(path.into_iter().skip(1));
                Cow::Owned(path_normalized)
            })
            .ok_or(HomeDirNotFound)
    } else {
        Ok(Cow::Borrowed(path))
    }
}
/// Returns the path without special expansion characters.
///
/// Currently this only expands `~` to the user's home directory.
/// Symlinks are not converted.
Returns the path without special expansion characters.
Currently this only expands `~` to the user's home directory.
Symlinks are not converted.
Returns the path without special expansion characters . Currently this only expands ` ~ ` to the user ' s home directory . Symlinks are not converted .
pub fn plain(path: &Path) -> Result<Cow<'_, Path>, HomeDirNotFound> {
    if path.starts_with("~") {
        // Replace `~` with user's home directory.
        dirs::home_dir()
            .map(|mut path_normalized| {
                path_normalized.extend(path.into_iter().skip(1));
                Cow::Owned(path_normalized)
            })
            .ok_or(HomeDirNotFound)
    } else {
        Ok(Cow::Borrowed(path))
    }
}
pub fn plain ( path : & Path ) -> Result < Cow < ' _ , Path > , HomeDirNotFound > { if path . starts_with ( " " ) { // Replace `~` with user's home directory. dirs :: home_dir ( ) . map ( | mut path_normalized | { path_normalized . extend ( path . into_iter ( ) . skip ( 1 ) ) ; Cow :: Owned ( path_normalized ) } ) . ok_or ( HomeDirNotFound ) } else { Ok ( Cow :: Borrowed ( path ) ) } }
Returns the path without special expansion characters.
Returns the path without special expansion characters .
path
&Path