Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Oct 21, 2023
1 parent 9a56542 commit c15a236
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
9 changes: 8 additions & 1 deletion cargo-crev/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,14 @@ fn run_command(command: opts::Command) -> Result<CommandExitStatus> {
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()?)?,
Expand Down
3 changes: 2 additions & 1 deletion cargo-crev/src/review.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::{
edit, opts::{self, ReviewCrateSelector},
edit,
opts::CargoOpts,
opts::{self, ReviewCrateSelector},
prelude::*,
term, url_to_status_str,
};
Expand Down
6 changes: 5 additions & 1 deletion cargo-crev/src/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,11 @@ pub fn are_we_called_from_goto_shell() -> Option<OsString> {
/// 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<F>(args: &opts::ReviewCrateSelector, local_for_review: Option<&Local>, f: F) -> Result<()>
pub fn handle_goto_mode_command<F>(
args: &opts::ReviewCrateSelector,
local_for_review: Option<&Local>,
f: F,
) -> Result<()>
where
F: FnOnce(&ReviewCrateSelector) -> Result<()>,
{
Expand Down
5 changes: 2 additions & 3 deletions crev-lib/src/local.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions crevette/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c15a236

Please sign in to comment.