We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5353153 commit 1656112Copy full SHA for 1656112
crates/macros/src/parsing.rs
@@ -118,14 +118,11 @@ impl MethodRename for &str {
118
RenameRule::None => self.to_string(),
119
_ => {
120
if MAGIC_METHOD.contains(self) {
121
- if self == &MAGIC_METHOD[12] {
122
- "__toString".to_string()
123
- } else if self == &MAGIC_METHOD[16] {
124
- "__debugInfo".to_string()
125
- } else if self == &MAGIC_METHOD[3] {
126
- "__callStatic".to_string()
127
- } else {
128
- self.to_string()
+ match *self {
+ "__to_string" => "__toString".to_string(),
+ "__debug_info" => "__debugInfo".to_string(),
+ "__call_static" => "__callStatic".to_string(),
+ _ => self.to_string(),
129
}
130
} else {
131
self.rename(rule)
0 commit comments