diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-27 03:52:05 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-27 04:21:34 +0900 |
| commit | 2b51554ff59d1e5cbf8dd2db65d278b0202a9102 (patch) | |
| tree | f4d9b0abf4df9b5e363e3bd65511d70e3d5ada00 /crates/shirabe/src/json | |
| parent | cc07b5abb83a40d678401c335bdc49bb81b72c5f (diff) | |
| download | php-shirabe-2b51554ff59d1e5cbf8dd2db65d278b0202a9102.tar.gz php-shirabe-2b51554ff59d1e5cbf8dd2db65d278b0202a9102.tar.zst php-shirabe-2b51554ff59d1e5cbf8dd2db65d278b0202a9102.zip | |
refactor: fix compiler warnings and clippy warnings
Diffstat (limited to 'crates/shirabe/src/json')
| -rw-r--r-- | crates/shirabe/src/json/json_file.rs | 2 | ||||
| -rw-r--r-- | crates/shirabe/src/json/json_manipulator.rs | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crates/shirabe/src/json/json_file.rs b/crates/shirabe/src/json/json_file.rs index 5da1a27..27540fe 100644 --- a/crates/shirabe/src/json/json_file.rs +++ b/crates/shirabe/src/json/json_file.rs @@ -338,7 +338,7 @@ impl JsonFile { schema_file: Option<&str>, ) -> Result<bool> { let mut is_composer_schema_file = false; - let mut schema_file = match schema_file { + let schema_file = match schema_file { Some(f) => f.into(), None => { if schema == Self::LOCK_SCHEMA { diff --git a/crates/shirabe/src/json/json_manipulator.rs b/crates/shirabe/src/json/json_manipulator.rs index 71530d4..c62e31e 100644 --- a/crates/shirabe/src/json/json_manipulator.rs +++ b/crates/shirabe/src/json/json_manipulator.rs @@ -5,9 +5,9 @@ use indexmap::IndexMap; use shirabe_external_packages::composer::pcre::{CaptureKey, Preg}; use shirabe_php_shim::{ InvalidArgumentException, LogicException, PhpMixed, addcslashes, array_key_exists, array_keys, - array_reverse, count, empty, explode, implode, in_array, is_array, is_int, is_numeric, - json_decode, preg_quote, rtrim, str_contains, str_repeat, str_replace, strlen, strnatcmp, - strpos, substr, trim, uksort, + array_reverse, empty, explode, implode, in_array, is_array, is_int, is_numeric, json_decode, + preg_quote, rtrim, str_contains, str_repeat, str_replace, strlen, strnatcmp, strpos, substr, + trim, uksort, }; use crate::json::JsonFile; @@ -838,7 +838,7 @@ impl JsonManipulator { // no node or empty node let main_node_value = decoded.as_array().and_then(|a| a.get(main_node)); - if main_node_value.map(|v| empty(v)).unwrap_or(true) { + if main_node_value.map(empty).unwrap_or(true) { return Ok(true); } @@ -1220,7 +1220,7 @@ impl JsonManipulator { // no node or empty node let main_node_value = decoded.as_array().and_then(|a| a.get(main_node)); - if main_node_value.map(|v| empty(v)).unwrap_or(true) { + if main_node_value.map(empty).unwrap_or(true) { return Ok(true); } |
