aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-class-map-generator
diff options
context:
space:
mode:
Diffstat (limited to 'crates/shirabe-class-map-generator')
-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()))