From 9e5bb3e4253dda96345f4d1a3421077a72295048 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 15 Aug 2026 09:10:16 +0900 Subject: 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` for it, so move them to the slice form. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe/src/util/gitlab.rs | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'crates/shirabe/src/util') 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 = 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( -- cgit v1.3.1-4-g156e