/// Provide rudimentary validation of the provided files. E.g.,
///
/// * All files exist
/// * All paths are different
Provide rudimentary validation of the provided files. E.g.,
All files exist
All paths are different
Provide rudimentary validation of the provided files . E . g . All files exist All paths are different
pub fn validate(&self) -> ReleaseResult<()> {
        let paths = self
            .entries
            .values()
            .filter_map(|v| match v {
                Value::File(p) => Some(p.clone()),
                _ => None,
            })
            .collect::<Vec<_>>();
        // all files exist
        if let Some(path) = paths.iter().find(|p| !p.exists()) {
            return Err(ReleaseError::file_not_found(path));
        }
        // all paths are unique
        let unique_paths: BTreeSet<_> = paths.iter().collect();
        if unique_paths.len() != paths.len() {
            return Err(ReleaseError::NonUniquePaths);
        }
        Ok(())
    }
pub fn validate ( & self ) -> ReleaseResult < ( ) > { let paths = self . entries . values ( ) . filter_map ( | v | match v { Value :: File ( p ) => Some ( p . clone ( ) ) , _ => None , } ) . collect :: < Vec < _ > > ( ) ; // all files exist if let Some ( path ) = paths . iter ( ) . find ( | p | ! p . exists ( ) ) { return Err ( ReleaseError :: file_not_found ( path ) ) ; } // all paths are unique let unique_paths : BTreeSet < _ > = paths . iter ( ) . collect ( ) ; if unique_paths . len ( ) != paths . len ( ) { return Err ( ReleaseError :: NonUniquePaths ) ; } Ok ( ( ) ) }
Provide rudimentary validation of the provided files.
Provide rudimentary validation of the provided files .
&self