diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-15 09:10:16 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-15 09:10:16 +0900 |
| commit | 9e5bb3e4253dda96345f4d1a3421077a72295048 (patch) | |
| tree | 73237dd78c22e93fe6562a434bb5ffcb03055250 /crates/shirabe/src/util/gitlab.rs | |
| parent | 8724f55749a97fe6a6e232d1dd900a069f9b7533 (diff) | |
| download | php-shirabe-9e5bb3e4253dda96345f4d1a3421077a72295048.tar.gz php-shirabe-9e5bb3e4253dda96345f4d1a3421077a72295048.tar.zst php-shirabe-9e5bb3e4253dda96345f4d1a3421077a72295048.zip | |
refactor(php-shim): take only the data argument in http_build_query
`http_build_query` ignores `numeric_prefix` because a string-keyed slice never
holds an integer key, and every caller passes `"&"` as the separator. Drop both
parameters and hard-code the separator.
Callers that pass a map of scalar literals to `http_build_query_mixed` no longer
need to build an `IndexMap<String, PhpMixed>` for it, so move them to the slice
form.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/util/gitlab.rs')
| -rw-r--r-- | crates/shirabe/src/util/gitlab.rs | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/crates/shirabe/src/util/gitlab.rs b/crates/shirabe/src/util/gitlab.rs index 73806762..3d1fb2be 100644 --- a/crates/shirabe/src/util/gitlab.rs +++ b/crates/shirabe/src/util/gitlab.rs @@ -425,15 +425,11 @@ impl GitLab { let headers = vec!["Content-Type: application/x-www-form-urlencoded".to_string()]; let api_url = origin_url; - let data = http_build_query( - &[ - ("username", username.as_str()), - ("password", password.as_str()), - ("grant_type", "password"), - ], - "", - "&", - ); + let data = http_build_query(&[ + ("username", username.as_str()), + ("password", password.as_str()), + ("grant_type", "password"), + ]); let mut http_inner: IndexMap<String, PhpMixed> = IndexMap::new(); http_inner.insert("method".to_string(), PhpMixed::String("POST".to_string())); http_inner.insert( @@ -498,14 +494,10 @@ impl GitLab { let headers = vec!["Content-Type: application/x-www-form-urlencoded".to_string()]; - let data = http_build_query( - &[ - ("refresh_token", refresh_token.as_str()), - ("grant_type", "refresh_token"), - ], - "", - "&", - ); + let data = http_build_query(&[ + ("refresh_token", refresh_token.as_str()), + ("grant_type", "refresh_token"), + ]); let mut http_inner = IndexMap::new(); http_inner.insert("method".to_string(), PhpMixed::String("POST".to_string())); http_inner.insert( |
