/// Match a vulnerability according to the given audit options
Match a vulnerability according to the given audit options
Match a vulnerability according to the given audit options
fn match_vulnerability(vuln: &Vulnerability, opts: &AuditOpts) -> bool {
    if let Some(ref target_arch) = opts.target_arch {
        if let Some(ref architectures) = vuln.advisory.affected_arch {
            if !architectures.iter().any(|arch| arch == target_arch) {
                return false;
            }
        }
    }
    if let Some(ref target_os) = opts.target_os {
        if let Some(ref operating_systems) = vuln.advisory.affected_os {
            if !operating_systems.iter().any(|os| os == target_os) {
                return false;
            }
        }
    }
    true
}
fn match_vulnerability ( vuln : & Vulnerability , opts : & AuditOpts ) -> bool { if let Some ( ref target_arch ) = opts . target_arch { if let Some ( ref architectures ) = vuln . advisory . affected_arch { if ! architectures . iter ( ) . any ( | arch | arch == target_arch ) { return false ; } } } if let Some ( ref target_os ) = opts . target_os { if let Some ( ref operating_systems ) = vuln . advisory . affected_os { if ! operating_systems . iter ( ) . any ( | os | os == target_os ) { return false ; } } } true }
Match a vulnerability according to the given audit options
Match a vulnerability according to the given audit options
vuln
&Vulnerability
opts
&AuditOpts