Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Aug 1, 2024
1 parent 779ccca commit d00758b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
14 changes: 7 additions & 7 deletions src/command/changelog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn changelog(opts: Options, crates: Vec<String>) -> anyhow::Result<()> {
if let Some(bat) = bat.as_ref() {
bat.display_to_tty(
lock.lock_path(),
lock.resource_path().strip_prefix(&ctx.root.to_path_buf())?,
lock.resource_path().strip_prefix(ctx.root.to_path_buf())?,
format!("PREVIEW {} / {}, press Ctrl+C to cancel", idx + 1, crates.len()),
)?;
}
Expand Down Expand Up @@ -141,11 +141,11 @@ fn assure_working_tree_is_unchanged(options: Options) -> anyhow::Result<()> {
Ok(())
} else {
crate::git::assure_clean_working_tree().or_else(|err|
if options.dry_run {
log::warn!("The working tree has changes which will prevent changelog updates with --write unless --allow-dirty is also specified. The latter isn't recommended.");
Ok(())
} else {
Err(err)
})
if options.dry_run {
log::warn!("The working tree has changes which will prevent changelog updates with --write unless --allow-dirty is also specified. The latter isn't recommended.");
Ok(())
} else {
Err(err)
})
}
}
4 changes: 2 additions & 2 deletions src/command/release/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ fn preview_changelogs(
);
bat.display_to_tty(
lock.lock_path(),
lock.resource_path().strip_prefix(&ctx.base.root.to_path_buf())?,
lock.resource_path().strip_prefix(ctx.base.root.to_path_buf())?,
additional_info,
)?;
}
Expand Down Expand Up @@ -534,7 +534,7 @@ fn set_version_and_update_package_dependency(
let force_update = conservative_pre_release_version_handling
&& version::is_pre_release(new_version) // setting the lower bound unnecessarily can be harmful
// don't claim to be conservative if this is necessary anyway
&& req_as_version(&version_req).map_or(false, |req_version|!version::rhs_is_breaking_bump_for_lhs(&req_version, new_version));
&& req_as_version(&version_req).map_or(false, |req_version| !version::rhs_is_breaking_bump_for_lhs(&req_version, new_version));
if !version_req.matches(new_version) || force_update {
if !version_req_unset_or_default(&version_req) {
bail!(
Expand Down
5 changes: 4 additions & 1 deletion src/git/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ pub mod history;

#[derive(Clone, Debug)]
pub enum PackageChangeKind {
Untagged { wanted_tag_name: String },
Untagged {
#[allow(dead_code)] // only used for debug printing maybe?
wanted_tag_name: String,
},
ChangedOrNew,
}

Expand Down
1 change: 1 addition & 0 deletions src/traverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ pub mod dependency {
Breakage {
bump: version::Bump,
/// Set if there is a change at all, which might not be the case for previously skipped crates.
#[allow(dead_code)] // strange that this isn't used, indeed!
change: Option<git::PackageChangeKind>,
/// The direct dependency causing the breakage because it's breaking itself
causing_dependency_names: Vec<String>,
Expand Down

0 comments on commit d00758b

Please sign in to comment.