Commit ad974a64 authored by Kornel's avatar Kornel
Browse files

Merge branch 'show-crev-advisories' into 'main'

Show crev advisories

Closes #88

See merge request !8
parents 1e3771ce f4428408
......@@ -23,7 +23,10 @@ impl Creviews {
let db = self.local.load_db()?;
let mut reviews: Vec<_> = db.get_pkg_reviews_for_name("https://crates.io", crate_name).filter_map(|r| {
let review = r.review()?;
let (thoroughness, understanding, rating) = r
.review()
.map(|r| (r.thoroughness, r.understanding, r.rating))
.unwrap_or_else(|| (Level::None, Level::None, Rating::Neutral));
let from = r.from();
let mut issues = Vec::new();
......@@ -47,9 +50,9 @@ impl Creviews {
author_url: db.lookup_url(&from.id).verified().map(|u| u.url.to_string()),
unmaintained: r.flags.unmaintained,
version: r.package.id.version.clone(),
thoroughness: review.thoroughness,
understanding: review.understanding,
rating: review.rating,
thoroughness,
understanding,
rating,
comment_markdown: r.comment.clone(),
date: r.common.date,
issues,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment