fn title_type(advisory: &rustsec::Advisory) -> String {
    use rustsec::advisory::Informational;

    let id = advisory.id().as_str();
    let package = advisory.metadata.package.as_str();

    match &advisory.metadata.informational {
        Some(Informational::Notice) => format!("{}: Security notice about {}", id, package),
        Some(Informational::Unmaintained) => format!("{}: {} is unmaintained", id, package),
        Some(Informational::Unsound) => format!("{}: Unsoundness in {}", id, package),
        Some(Informational::Other(s)) => format!("{}: {} is {}", id, package, s),
        Some(_) => format!("{}: Advisory for {}", id, package),
        // Not informational => vulnerability
        None => format!("{}: Vulnerability in {}", id, package),
    }
}
/// Title with the id, the package name and the advisory type
Title with the id, the package name and the advisory type
Title with the id the package name and the advisory type
fn title_type(advisory: &rustsec::Advisory) -> String {
    use rustsec::advisory::Informational;
    let id = advisory.id().as_str();
    let package = advisory.metadata.package.as_str();
    match &advisory.metadata.informational {
        Some(Informational::Notice) => format!("{}: Security notice about {}", id, package),
        Some(Informational::Unmaintained) => format!("{}: {} is unmaintained", id, package),
        Some(Informational::Unsound) => format!("{}: Unsoundness in {}", id, package),
        Some(Informational::Other(s)) => format!("{}: {} is {}", id, package, s),
        Some(_) => format!("{}: Advisory for {}", id, package),
        // Not informational => vulnerability
        None => format!("{}: Vulnerability in {}", id, package),
    }
}
fn title_type ( advisory : & rustsec :: Advisory ) -> String { use rustsec :: advisory :: Informational ; let id = advisory . id ( ) . as_str ( ) ; let package = advisory . metadata . package . as_str ( ) ; match & advisory . metadata . informational { Some ( Informational :: Notice ) => format ! ( " " id package ) , Some ( Informational :: Unmaintained ) => format ! ( " " id package ) , Some ( Informational :: Unsound ) => format ! ( " " id package ) , Some ( Informational :: Other ( s ) ) => format ! ( " " id package s ) , Some ( _ ) => format ! ( " " id package ) , // Not informational => vulnerability None => format ! ( " " id package ) , } }
Title with the id, the package name and the advisory type
Title with the id the package name and the advisory type
advisory
&rustsec::Advisory
advisory
&rustsec::Advisory