handle_path

Function handle_path 

Source
pub fn handle_path<P>(path: P, kind: PathKind, option: TakeOption) -> Result<P>
where P: AsRef<Path>,
Expand description

§Handles path

This function verifies path kind and handles option. New directory or new file will be made if necessary. On success, it returns the input path.

§Examples

use dia_args::paths::{self, PathKind, TakeOption};

assert_eq!(
    paths::handle_path(file!(), PathKind::File, TakeOption::MustExist)?,
    file!(),
);