Skip to content

Commit 3aa37ef

Browse files
Use bool::then
Co-authored-by: Daniel Szoke <[email protected]>
1 parent 8a5d549 commit 3aa37ef

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/commands/build/upload.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -291,11 +291,7 @@ fn collect_git_metadata(matches: &ArgMatches, config: &Config, auto_collect: boo
291291
.get_one::<Option<Digest>>("head_sha")
292292
.map(|d| d.as_ref().cloned())
293293
.or_else(|| {
294-
if auto_collect {
295-
Some(vcs::find_head_sha().ok())
296-
} else {
297-
None
298-
}
294+
auto_collect.then(|| vcs::find_head_sha().ok())
299295
})
300296
.flatten();
301297

0 commit comments

Comments
 (0)