aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src/var.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-10 02:48:46 +0900
committernsfisis <nsfisis@gmail.com>2026-08-10 02:48:46 +0900
commit54760d5c73ca20de2e155df274d576cec9ea0ed0 (patch)
treec568b65ce51513a6e38491bec84c0eb05e44bd15 /crates/shirabe-php-shim/src/var.rs
parentbbf33b836026cbe9fb9e7c76291dcb133b7144e2 (diff)
downloadphp-shirabe-54760d5c73ca20de2e155df274d576cec9ea0ed0.tar.gz
php-shirabe-54760d5c73ca20de2e155df274d576cec9ea0ed0.tar.zst
php-shirabe-54760d5c73ca20de2e155df274d576cec9ea0ed0.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src/var.rs')
-rw-r--r--crates/shirabe-php-shim/src/var.rs32
1 files changed, 16 insertions, 16 deletions
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<i64> {
key.parse::<i64>().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,