diff --git a/cargo-crev/src/main.rs b/cargo-crev/src/main.rs index 448099fc..0bc355f2 100644 --- a/cargo-crev/src/main.rs +++ b/cargo-crev/src/main.rs @@ -586,7 +586,14 @@ fn run_command(command: opts::Command) -> Result { if args.is_empty() && are_we_called_from_goto_shell().is_none() { clean_all_crates_with_digest_mismatch()?; } else { - handle_goto_mode_command(&ReviewCrateSelector { crate_: args.clone(), diff: None }, None, |sel| clean_crate(&sel.crate_))?; + handle_goto_mode_command( + &ReviewCrateSelector { + crate_: args.clone(), + diff: None, + }, + None, + |sel| clean_crate(&sel.crate_), + )?; } } opts::Crate::Dir(args) => show_dir(&args.common.crate_.auto_unrelated()?)?, diff --git a/cargo-crev/src/review.rs b/cargo-crev/src/review.rs index 6223b2e6..a5e097c4 100644 --- a/cargo-crev/src/review.rs +++ b/cargo-crev/src/review.rs @@ -1,6 +1,7 @@ use crate::{ - edit, opts::{self, ReviewCrateSelector}, + edit, opts::CargoOpts, + opts::{self, ReviewCrateSelector}, prelude::*, term, url_to_status_str, }; diff --git a/cargo-crev/src/shared.rs b/cargo-crev/src/shared.rs index a3490253..f259e9f7 100644 --- a/cargo-crev/src/shared.rs +++ b/cargo-crev/src/shared.rs @@ -599,7 +599,11 @@ pub fn are_we_called_from_goto_shell() -> Option { /// After jumping to a crate with `goto`, the crate is selected /// already, and commands like `review` must not be given any arguments /// like that. -pub fn handle_goto_mode_command(args: &opts::ReviewCrateSelector, local_for_review: Option<&Local>, f: F) -> Result<()> +pub fn handle_goto_mode_command( + args: &opts::ReviewCrateSelector, + local_for_review: Option<&Local>, + f: F, +) -> Result<()> where F: FnOnce(&ReviewCrateSelector) -> Result<()>, { diff --git a/crev-lib/src/local.rs b/crev-lib/src/local.rs index 414134c5..93c1a8db 100644 --- a/crev-lib/src/local.rs +++ b/crev-lib/src/local.rs @@ -1,5 +1,5 @@ use crate::{ - activity::{ReviewActivity, LatestReviewActivity}, + activity::{LatestReviewActivity, ReviewActivity}, id::{self, LockedId, PassphraseFn}, util::{self, git::is_unrecoverable}, Error, ProofStore, Result, Warning, @@ -375,8 +375,7 @@ impl Local { } fn cache_latest_review_activity_path(&self) -> PathBuf { - self.cache_activity_path() - .join("latest_review.yaml") + self.cache_activity_path().join("latest_review.yaml") } /// Most recent in-progress review diff --git a/crevette/src/lib.rs b/crevette/src/lib.rs index 2b7816f9..6cb67a91 100644 --- a/crevette/src/lib.rs +++ b/crevette/src/lib.rs @@ -86,10 +86,12 @@ impl Crevette { format!("https://raw.githubusercontent.com/{rest}/HEAD/audits.toml"), rest.split('/').next().unwrap_or_default().into(), )) - } else { u.strip_prefix("https://gitlab.com/").map(|rest| ( + } else { + u.strip_prefix("https://gitlab.com/").map(|rest| ( format!("https://gitlab.com/{rest}/-/raw/HEAD/audits.toml"), rest.split('/').next().unwrap_or_default().into(), - )) } + )) + } }) .unzip(); @@ -302,12 +304,10 @@ fn criteria_for_non_negative_review(trust: TrustLevel, r: &Package, review: &Rev >= level_as_score(Level::Medium) + level_as_score(Level::Medium) } Rating::Positive => { - review_quality_score - >= level_as_score(Level::Medium) + level_as_score(Level::Low) + review_quality_score >= level_as_score(Level::Medium) + level_as_score(Level::Low) } Rating::Strong => { - review_quality_score - >= level_as_score(Level::Low) + level_as_score(Level::Low) + review_quality_score >= level_as_score(Level::Low) + level_as_score(Level::Low) } }; let safe_to_deploy = safe_to_run