Skip to content

Commit 92c4374

Browse files
committed
Replace another use of .then() with if-then
Clippy has begun to disapprove of such uses that can be expressed no less complicatedly with `if`-`then`, but while it was able to detect this one like the others, it was not able to auto-fix it. A direct refactoring might use `Default::default()`, but `"".into()` seems slightly more readable here for showing the effect on the message that gets built into the log.
1 parent 344f250 commit 92c4374

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/command/release/mod.rs

Lines changed: 5 additions & 3 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!(

0 commit comments

Comments
 (0)