From 54760d5c73ca20de2e155df274d576cec9ea0ed0 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 10 Aug 2026 02:48:46 +0900 Subject: style(php-shim): drop the underscore from used parameter names These parameters kept the leading underscore they were given while their function bodies were still todo!(), and the underscore now reads as "this argument is ignored" for arguments the bodies do use. Removing the prefix stops it from suppressing four clippy lints, fixed alongside: one redundant field name, and three `&mut Vec` parameters that only need a slice. Co-Authored-By: Claude Opus 5 (1M context) --- crates/shirabe-php-shim/src/var.rs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'crates/shirabe-php-shim/src/var.rs') diff --git a/crates/shirabe-php-shim/src/var.rs b/crates/shirabe-php-shim/src/var.rs index af3c1b3b..bf8fa0ce 100644 --- a/crates/shirabe-php-shim/src/var.rs +++ b/crates/shirabe-php-shim/src/var.rs @@ -93,21 +93,21 @@ pub fn canonical_int_key(key: &str) -> Option { key.parse::().ok() } -pub fn is_bool(_value: &PhpMixed) -> bool { - matches!(_value, PhpMixed::Bool(_)) +pub fn is_bool(value: &PhpMixed) -> bool { + matches!(value, PhpMixed::Bool(_)) } -pub fn is_string(_value: &PhpMixed) -> bool { - matches!(_value, PhpMixed::String(_)) +pub fn is_string(value: &PhpMixed) -> bool { + matches!(value, PhpMixed::String(_)) } -pub fn is_int(_value: &PhpMixed) -> bool { - matches!(_value, PhpMixed::Int(_)) +pub fn is_int(value: &PhpMixed) -> bool { + matches!(value, PhpMixed::Int(_)) } -pub fn is_scalar(_value: &PhpMixed) -> bool { +pub fn is_scalar(value: &PhpMixed) -> bool { matches!( - _value, + value, PhpMixed::Bool(_) | PhpMixed::Int(_) | PhpMixed::Float(_) | PhpMixed::String(_) ) } @@ -131,8 +131,8 @@ pub fn is_callable(value: &PhpMixed) -> bool { } } -pub fn is_object(_value: &PhpMixed) -> bool { - matches!(_value, PhpMixed::Object(_)) +pub fn is_object(value: &PhpMixed) -> bool { + matches!(value, PhpMixed::Object(_)) } pub fn is_a(_object_or_class: &PhpMixed, _class: &str, _allow_string: bool) -> bool { @@ -141,12 +141,12 @@ pub fn is_a(_object_or_class: &PhpMixed, _class: &str, _allow_string: bool) -> b todo!() } -pub fn is_array(_value: &PhpMixed) -> bool { - matches!(_value, PhpMixed::List(_) | PhpMixed::Array(_)) +pub fn is_array(value: &PhpMixed) -> bool { + matches!(value, PhpMixed::List(_) | PhpMixed::Array(_)) } -pub fn is_null(_value: &PhpMixed) -> bool { - matches!(_value, PhpMixed::Null) +pub fn is_null(value: &PhpMixed) -> bool { + matches!(value, PhpMixed::Null) } pub fn is_iterable(value: &PhpMixed) -> bool { @@ -255,9 +255,9 @@ pub fn strval(value: &PhpMixed) -> String { php_to_string(value) } -pub fn intval(_value: &PhpMixed) -> i64 { +pub fn intval(value: &PhpMixed) -> i64 { // Single-argument PHP intval(), i.e. base 10. - match _value { + match value { PhpMixed::Null => 0, PhpMixed::Bool(b) => *b as i64, PhpMixed::Int(i) => *i, -- cgit v1.3.1-4-g156e