pub fn validate_path(path: &PathBuf) -> Result<&PathBuf>Expand description
Validates a given path to ensure it exists and is a directory.
This function checks whether the provided path exists and is a directory, returning an error if either condition is not met.
§Arguments
path- A reference to aPathBufrepresenting the path to validate.
§Returns
Ok(&PathBuf)- A reference to the validatedPathBufif the path exists and is a directory.Err(anyhow::Error)- An error indicating why the path is invalid.