From e283399a0304846bbff8484f455c50ecb3de7048 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 21 Jun 2026 20:27:13 +0900 Subject: refactor(php-shim): drop reset()/reset_first()/end_arr() array helpers These slice/map wrappers mirrored PHP's internal array pointer and have no clean Rust equivalent. Remove them and replace the lone caller with direct first-element access; the rest were unused imports. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe/src/config.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/shirabe/src/config.rs') diff --git a/crates/shirabe/src/config.rs b/crates/shirabe/src/config.rs index dfc99a6..68cad87 100644 --- a/crates/shirabe/src/config.rs +++ b/crates/shirabe/src/config.rs @@ -13,8 +13,8 @@ use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ E_USER_DEPRECATED, PHP_URL_HOST, PHP_URL_SCHEME, PhpMixed, RuntimeException, array_key_exists, array_merge, array_reverse, array_search_mixed, array_unique, empty, filter_var_url, implode, - in_array, is_array, is_int, is_string, parse_url, php_to_string, reset, rtrim, strtolower, - strtoupper, strtr, substr, trigger_error, + in_array, is_array, is_int, is_string, parse_url, php_to_string, rtrim, strtolower, strtoupper, + strtr, substr, trigger_error, }; use std::cell::RefCell; @@ -866,7 +866,7 @@ impl Config { } } } - let first = reset(&protos); + let first = protos.first().cloned(); if first.as_deref() == Some("http") { return Err(RuntimeException { message: "The http protocol for github is not available anymore, update your config's github-protocols to use \"https\", \"git\" or \"ssh\"".to_string(), -- cgit v1.3.1