fn input_prefetch_files_verify(input: &Option<Vec<String>>) -> DaemonResult<Option<Vec<PathBuf>>> {
    let prefetch_files: Option<Vec<PathBuf>> = input
        .as_ref()
        .map(|files| files.iter().map(PathBuf::from).collect());

    if let Some(files) = &prefetch_files {
        for f in files.iter() {
            if !f.starts_with(Path::new("/")) {
                return Err(DaemonError::Common("Illegal prefetch list".to_string()));
            }
        }
    }

    Ok(prefetch_files)
}
/// Validate prefetch file list command line parameter.
///
/// A string including multiple directories and regular files should be separated by white-spaces, e.g.
///      <path1> <path2> <path3>
/// And each path should be relative to rafs root, e.g.
///      /foo1/bar1 /foo2/bar2
/// Specifying both regular file and directory simultaneously is supported.
Validate prefetch file list command line parameter.
A string including multiple directories and regular files should be separated by white-spaces, e.g.
  
And each path should be relative to rafs root, e.g.
foo1/bar1 /foo2/bar2
Specifying both regular file and directory simultaneously is supported.
Validate prefetch file list command line parameter . A string including multiple directories and regular files should be separated by white - spaces e . g . And each path should be relative to rafs root e . g . foo1 / bar1 / foo2 / bar2 Specifying both regular file and directory simultaneously is supported .
fn input_prefetch_files_verify(input: &Option<Vec<String>>) -> DaemonResult<Option<Vec<PathBuf>>> {
    let prefetch_files: Option<Vec<PathBuf>> = input
        .as_ref()
        .map(|files| files.iter().map(PathBuf::from).collect());
    if let Some(files) = &prefetch_files {
        for f in files.iter() {
            if !f.starts_with(Path::new("/")) {
                return Err(DaemonError::Common("Illegal prefetch list".to_string()));
            }
        }
    }
    Ok(prefetch_files)
}
fn input_prefetch_files_verify ( input : & Option < Vec < String > > ) -> DaemonResult < Option < Vec < PathBuf > > > { let prefetch_files : Option < Vec < PathBuf > > = input . as_ref ( ) . map ( | files | files . iter ( ) . map ( PathBuf :: from ) . collect ( ) ) ; if let Some ( files ) = & prefetch_files { for f in files . iter ( ) { if ! f . starts_with ( Path :: new ( " " ) ) { return Err ( DaemonError :: Common ( " " . to_string ( ) ) ) ; } } } Ok ( prefetch_files ) }
Validate prefetch file list command line parameter.
Validate prefetch file list command line parameter .
input
&Option<Vec<String>>
input
&Option<Vec<String>>