fn check_file(file: &str) -> Result<(), String> {
    let file_path = Path::new(&file);
    if !file_path.exists() {
        Err(String::from("File doesn't exist!"))
    } else if !file_path.is_file() {
        Err(String::from("Given path is not a valid file!"))
    } else {
        Ok(())
    }
}
/// Function used to check if path are files and exists for Clap
Function used to check if path are files and exists for Clap
Function used to check if path are files and exists for Clap
fn check_file(file: &str) -> Result<(), String> {
    let file_path = Path::new(&file);
    if !file_path.exists() {
        Err(String::from("File doesn't exist!"))
    } else if !file_path.is_file() {
        Err(String::from("Given path is not a valid file!"))
    } else {
        Ok(())
    }
}
fn check_file ( file : & str ) -> Result < ( ) , String > { let file_path = Path :: new ( & file ) ; if ! file_path . exists ( ) { Err ( String :: from ( " " ) ) } else if ! file_path . is_file ( ) { Err ( String :: from ( " " ) ) } else { Ok ( ( ) ) } }
Function used to check if path are files and exists for Clap
Function used to check if path are files and exists for Clap
file
&str
file
&str