From c09cd630afb4bb0ca10e926f93bf706ca828ae85 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sat, 20 Jun 2026 16:07:07 +0900 Subject: refactor(clippy): resolve idiomatic lint warnings Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/shirabe-class-map-generator/src/php_file_parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/shirabe-class-map-generator') 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())) -- cgit v1.3.1