Show number of outdated dependencies even if insecure crates are present (#73)

* Update to show number of outdated dependencies even if insecure crates are present

* add match statement to simplify if-else statment
This commit is contained in:
Henil 2020-10-26 23:10:45 +05:30 committed by GitHub
parent 0a22c413b3
commit 0764c00422
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,13 +41,12 @@ fn dependency_table(title: &str, deps: IndexMap<CrateName, AnalyzedDependency>)
html! { html! {
h3 class="title is-4" { (title) } h3 class="title is-4" { (title) }
p class="subtitle is-5" { p class="subtitle is-5" {
@if count_insecure > 0 { (match (count_outdated, count_insecure) {
(format!(" ({} total, {} insecure)", count_total, count_insecure)) (0, 0) => format!("({} total, all up-to-date)", count_total),
} @else if count_outdated > 0 { (0, _) => format!("({} total, {} insecure)", count_total, count_insecure),
(format!(" ({} total, {} up-to-date, {} outdated)", count_total, count_total - count_outdated, count_outdated)) (_, 0) => format!("({} total, {} outdated)", count_total, count_outdated),
} @else { (_, _) => format!("({} total, {} outdated, {} insecure)", count_total, count_outdated, count_insecure),
(format!(" ({} total, all up-to-date)", count_total)) })
}
} }
table class="table is-fullwidth is-striped is-hoverable" { table class="table is-fullwidth is-striped is-hoverable" {