diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-07-25 16:16:33 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-07-25 16:17:10 +0900 |
| commit | 432472808051cb4f1bb9517b858dbc810aaa5a63 (patch) | |
| tree | 4c58b97942853ea2c3f58368203fa93187746cf8 /crates/shirabe/src/downloader/git_downloader.rs | |
| parent | d4608662f28b9a5135986b1702afe3199957eabe (diff) | |
| download | php-shirabe-432472808051cb4f1bb9517b858dbc810aaa5a63.tar.gz php-shirabe-432472808051cb4f1bb9517b858dbc810aaa5a63.tar.zst php-shirabe-432472808051cb4f1bb9517b858dbc810aaa5a63.zip | |
refactor: replace redundant clones with moves
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/downloader/git_downloader.rs')
| -rw-r--r-- | crates/shirabe/src/downloader/git_downloader.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/shirabe/src/downloader/git_downloader.rs b/crates/shirabe/src/downloader/git_downloader.rs index eaedc453..c2599d2b 100644 --- a/crates/shirabe/src/downloader/git_downloader.rs +++ b/crates/shirabe/src/downloader/git_downloader.rs @@ -426,13 +426,13 @@ impl GitDownloader { } let mut command1: Vec<String> = vec!["git".to_string(), "checkout".to_string()]; - command1.extend(force.clone()); + command1.extend(force); command1.extend(vec![git_ref.clone(), "--".to_string()]); let command2 = vec![ "git".to_string(), "reset".to_string(), "--hard".to_string(), - git_ref.clone(), + git_ref, "--".to_string(), ]; { @@ -827,7 +827,7 @@ impl VcsDownloader for GitDownloader { io_interface::NORMAL, ); self.inner.io.write_error3( - &format!(" Cloning to cache at {}", cache_path.clone()), + &format!(" Cloning to cache at {}", cache_path), true, io_interface::DEBUG, ); @@ -909,7 +909,7 @@ impl VcsDownloader for GitDownloader { "git".to_string(), "clone".to_string(), "--no-checkout".to_string(), - cache_path.clone(), + cache_path, path.clone(), ]; base.extend(clone_flags); @@ -1054,7 +1054,7 @@ impl VcsDownloader for GitDownloader { .unwrap_or(false); if has_cached { msg = format!("Checking out {} from cache", self.get_short_hash(&r#ref)); - remote_url = cache_path.clone(); + remote_url = cache_path; } else { msg = format!("Checking out {}", self.get_short_hash(&r#ref)); remote_url = "%url%".to_string(); @@ -1092,7 +1092,7 @@ impl VcsDownloader for GitDownloader { "set-url".to_string(), "composer".to_string(), "--".to_string(), - remote_url.clone(), + remote_url, ], vec