Skip to content

Commit 3af51d7

Browse files
authored
Merge pull request #69 from EliahKagan/thanks-clippy
Thanks clippy
2 parents bee3e4c + 92c4374 commit 3af51d7

File tree

9 files changed

+19
-21
lines changed

9 files changed

+19
-21
lines changed

src/changelog/parse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ fn record_unknown_range(out: &mut Vec<section::Segment>, range: Option<Range<usi
427427
}
428428

429429
fn track_unknown_event(unknown_event: Event<'_>, unknown: &mut String) {
430-
log::trace!("Cannot handle {:?}", unknown_event);
430+
log::trace!("Cannot handle {unknown_event:?}");
431431
match unknown_event {
432432
Event::Html(text)
433433
| Event::Code(text)

src/command/changelog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub fn changelog(opts: Options, crates: Vec<String>) -> anyhow::Result<()> {
129129
change.commit()?;
130130
}
131131
if num_changes != 0 {
132-
log::info!("Wrote {} changelogs", num_changes);
132+
log::info!("Wrote {num_changes} changelogs");
133133
}
134134

135135
Ok(())

src/command/release/cargo.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ pub(in crate::command::release_impl) fn publish_crate(
5656
bail!("Could not successfully execute 'cargo publish'.")
5757
} else {
5858
log::warn!(
59-
"'cargo publish' run {} failed but we retry up to {} times to rule out flakiness",
60-
attempt,
61-
max_attempts
59+
"'cargo publish' run {attempt} failed but we retry up to {max_attempts} times to rule out flakiness"
6260
);
6361
}
6462
}

src/command/release/git.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ pub(in crate::command::release_impl) fn create_version_tag<'repo>(
5656
);
5757
}
5858
None => {
59-
log::trace!("WOULD create tag {}", tag_name);
59+
log::trace!("WOULD create tag {tag_name}");
6060
}
6161
}
6262
Ok(Some(format!("refs/tags/{tag_name}").try_into()?))

src/command/release/github.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ pub fn create_release(
6464
cmd.arg(notes);
6565
if !dry_run && !cmd.status()?.success() {
6666
log::warn!(
67-
"'gh' tool execution failed - considering this non-critical, and you may try to create the release with: {:?}",
68-
cmd
67+
"'gh' tool execution failed - considering this non-critical, and you may try to create the release with: {cmd:?}"
6968
);
7069
}
7170
Ok(())

src/command/release/manifest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn commit_locks_and_generate_bail_message(
246246
);
247247
if !allow_fully_generated_changelogs {
248248
for crate_name in crate_names {
249-
log::warn!("{} {}", fix_preamble, crate_name);
249+
log::warn!("{fix_preamble} {crate_name}");
250250
}
251251
}
252252
}

src/command/release/mod.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,11 @@ fn present_and_validate_dependencies(
269269
causes.iter().map(|n| format!("'{n}'")).collect::<Vec<_>>().join(", ")
270270
))
271271
.unwrap_or_default(),
272-
(bump.next_release != bump.desired_release)
273-
.then(|| format!(", ignoring computed version {}", bump.desired_release))
274-
.unwrap_or_default(),
272+
if bump.next_release == bump.desired_release {
273+
"".into()
274+
} else {
275+
format!(", ignoring computed version {}", bump.desired_release)
276+
},
275277
);
276278
} else if bump.desired_release != dep.package.version {
277279
log::info!(
@@ -358,9 +360,11 @@ fn present_and_validate_dependencies(
358360
.map(|d| d.package.name.as_str())
359361
.collect::<Vec<_>>();
360362
if !crate_names_for_manifest_updates.is_empty() {
361-
let plural_s = (crate_names_for_manifest_updates.len() > 1)
362-
.then_some("s")
363-
.unwrap_or_default();
363+
let plural_s = if crate_names_for_manifest_updates.len() > 1 {
364+
"s"
365+
} else {
366+
Default::default()
367+
};
364368
log::info!(
365369
"{} adjust version constraints in manifest{} of {} package{} as direct dependencies are changing: {}",
366370
will(dry_run),
@@ -502,7 +506,7 @@ fn wait_for_release(
502506
}
503507

504508
std::thread::sleep(sleep_time);
505-
log::info!("attempt {}", attempt);
509+
log::info!("attempt {attempt}");
506510
}
507511
Ok(())
508512
}

src/context.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,7 @@ fn fill_in_root_crate_if_needed(crate_names: Vec<String>) -> anyhow::Result<Vec<
8484
} else {
8585
dir_name.to_owned()
8686
};
87-
log::warn!(
88-
"Using '{}' as crate name as no one was provided. Specify one if this isn't correct",
89-
crate_name
90-
);
87+
log::warn!("Using '{crate_name}' as crate name as no one was provided. Specify one if this isn't correct");
9188
vec![crate_name]
9289
} else {
9390
crate_names

src/git/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ pub fn change_since_last_release(package: &Package, ctx: &crate::Context) -> any
4949
.peel_to_kind(object::Kind::Tree)?
5050
.into_tree()
5151
.peel_to_entry(components.clone())?
52-
.unwrap_or_else(|| panic!("path '{}' must exist in current_commit `{}`", dir, current_commit))
52+
.unwrap_or_else(|| panic!("path '{dir}' must exist in current_commit `{current_commit}`"))
5353
.object_id();
5454
if let Some(released_dir_entry) = released_target
5555
.object()?

0 commit comments

Comments
 (0)