Skip to content

Commit e49ed37

Browse files
killagu-clawclaude
andcommitted
fix: resolve clippy collapsible_if warnings
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 254abed commit e49ed37

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

crates/pm/src/util/downloader.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ pub async fn download_to_cache(name: &str, version: &str, tarball_url: &str) ->
4444
// Git packages are already cached during resolution.
4545
if tarball_url.starts_with("git+") || tarball_url.starts_with("git://") {
4646
let cache_dir = get_cache_dir();
47-
if let Some(cache_path) = utoo_ruborist::git::git_cache_path(&cache_dir, tarball_url) {
48-
if crate::fs::try_exists(&cache_path).await.unwrap_or(false) {
49-
tracing::debug!("Git package cache hit: {}@{}", name, version);
50-
return Some(cache_path);
51-
}
47+
if let Some(cache_path) = utoo_ruborist::git::git_cache_path(&cache_dir, tarball_url)
48+
&& crate::fs::try_exists(&cache_path).await.unwrap_or(false)
49+
{
50+
tracing::debug!("Git package cache hit: {}@{}", name, version);
51+
return Some(cache_path);
5252
}
5353
tracing::warn!(
5454
"Git package {}@{} not found in cache, expected pre-resolution",

crates/ruborist/src/resolver/git.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,11 @@ fn clone_repo_blocking(
125125
let is_full_sha =
126126
commit_ish.is_some_and(|c| c.len() == 40 && c.chars().all(|ch| ch.is_ascii_hexdigit()));
127127

128-
if let Some(ref_name) = commit_ish {
129-
if !is_full_sha {
130-
// Try as branch/tag ref
131-
prepare = prepare.with_ref_name(Some(ref_name))?;
132-
}
128+
if let Some(ref_name) = commit_ish
129+
&& !is_full_sha
130+
{
131+
// Try as branch/tag ref
132+
prepare = prepare.with_ref_name(Some(ref_name))?;
133133
}
134134

135135
let (checkout, _outcome) = prepare

0 commit comments

Comments
 (0)