aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-class-map-generator/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-20 16:07:07 +0900
committernsfisis <nsfisis@gmail.com>2026-06-20 16:07:30 +0900
commitc09cd630afb4bb0ca10e926f93bf706ca828ae85 (patch)
tree2147230e858c672cbea6e8dc7295763d98fd48d7 /crates/shirabe-class-map-generator/src
parent1b38bdb5a1de127ca8040f5a132d08c73ccb3c67 (diff)
downloadphp-shirabe-c09cd630afb4bb0ca10e926f93bf706ca828ae85.tar.gz
php-shirabe-c09cd630afb4bb0ca10e926f93bf706ca828ae85.tar.zst
php-shirabe-c09cd630afb4bb0ca10e926f93bf706ca828ae85.zip
refactor(clippy): resolve idiomatic lint warnings
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-class-map-generator/src')
-rw-r--r--crates/shirabe-class-map-generator/src/php_file_parser.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/shirabe-class-map-generator/src/php_file_parser.rs b/crates/shirabe-class-map-generator/src/php_file_parser.rs
index 323ca05..ae98a5c 100644
--- a/crates/shirabe-class-map-generator/src/php_file_parser.rs
+++ b/crates/shirabe-class-map-generator/src/php_file_parser.rs
@@ -131,13 +131,13 @@ impl PhpFileParser {
continue;
}
- let name: String = if name.starts_with(':') {
+ let name: String = if let Some(stripped) = name.strip_prefix(':') {
// This is an XHP class, https://github.com/facebook/xhp
"xhp".to_string()
+ &str_replace_array(
&["-".to_string(), ":".to_string()],
&["_".to_string(), "__".to_string()],
- &name[1..],
+ stripped,
)
} else if matches
.get(&CaptureKey::ByName("type".to_owned()))