Skip to main content

validate_files_exist

Function validate_files_exist 

Source
pub fn validate_files_exist<P: AsRef<Path>>(files: &[(P, &str)]) -> Result<()>
Expand description

Validate that multiple files exist

§Arguments

  • files - Slice of (path, description) tuples

§Errors

Returns an error for the first file that doesn’t exist

§Example

use fgumi_lib::validation::validate_files_exist;
use std::path::PathBuf;

let files = vec![
    (PathBuf::from("input.bam"), "Input BAM"),
    (PathBuf::from("ref.fa"), "Reference"),
];
validate_files_exist(&files).unwrap();