diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-05-20 08:33:57 +0900 |
| commit | f31b101ce1e921a026ba234b1f0a83b0392bc118 (patch) | |
| tree | b7ac2aa84d71ebd162cc21aeab0240e7e0544988 /crates/shirabe/src/command/repository_command.rs | |
| parent | 5e31fa33c3b5cf726a57a063b8e7a070869250fe (diff) | |
| download | php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.gz php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.tar.zst php-shirabe-f31b101ce1e921a026ba234b1f0a83b0392bc118.zip | |
fix(compile): fix all remaining compile errors
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/repository_command.rs')
| -rw-r--r-- | crates/shirabe/src/command/repository_command.rs | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/crates/shirabe/src/command/repository_command.rs b/crates/shirabe/src/command/repository_command.rs index 279e9de..306c52f 100644 --- a/crates/shirabe/src/command/repository_command.rs +++ b/crates/shirabe/src/command/repository_command.rs @@ -164,33 +164,21 @@ impl RepositoryCommand { } let reference_name = before.as_deref().or(after.as_deref()).unwrap(); let offset: i64 = if after.is_some() { 1 } else { 0 }; - let repo_config_opt: Option<IndexMap<String, PhpMixed>> = match &repo_config { - PhpMixed::Array(m) => { - Some(m.iter().map(|(k, v)| (k.clone(), *v.clone())).collect()) - } - _ => None, - }; self.config_source.as_mut().unwrap().insert_repository( name.as_deref().unwrap(), - repo_config_opt, + repo_config.clone(), reference_name, offset, - ); + )?; return Ok(0); } let append = input.get_option("append").as_bool().unwrap_or(false); - let repo_config_opt: Option<IndexMap<String, PhpMixed>> = match &repo_config { - PhpMixed::Array(m) => { - Some(m.iter().map(|(k, v)| (k.clone(), *v.clone())).collect()) - } - _ => None, - }; self.config_source.as_mut().unwrap().add_repository( name.as_deref().unwrap(), - repo_config_opt, + repo_config.clone(), append, - ); + )?; Ok(0) } "remove" | "rm" | "delete" => { @@ -204,13 +192,13 @@ impl RepositoryCommand { self.config_source .as_mut() .unwrap() - .remove_repository(name_str); + .remove_repository(name_str)?; if ["packagist", "packagist.org"].contains(&name_str) { self.config_source.as_mut().unwrap().add_repository( "packagist.org", - None, + PhpMixed::Null, false, - ); + )?; } Ok(0) } @@ -326,7 +314,7 @@ impl RepositoryCommand { } } - fn list_repositories(&self, mut repos: IndexMap<String, PhpMixed>) { + fn list_repositories(&mut self, mut repos: IndexMap<String, PhpMixed>) { let io = self.get_io(); let mut packagist_present = false; |
