pub(crate) fn expand_home_dir( path: PathBuf, home_dir: Option<&Path>, ) -> Option<PathBuf>
If the first component of the path is ~, replaces it with the home dir. If no home dir is present, returns None.
~
None