Skip to content

Commit b913cd5

Browse files
committed
Updated to_moonbit_ident to match latest wit-bindgen-moonbit
1 parent 58b654f commit b913cd5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,14 +1001,14 @@ pub fn to_moonbit_ident(name: impl AsRef<str>) -> String {
10011001
// Reserved keywords
10021002
| "module" | "move" | "ref" | "static" | "super" | "unsafe" | "use" | "where" | "await"
10031003
| "dyn" | "abstract" | "do" | "final" | "macro" | "override" | "typeof" | "virtual" | "yield"
1004-
| "local" | "method" | "alias" | "assert" | "recur" | "isnot" | "define" | "downcast"
1004+
| "local" | "method" | "alias" | "assert" | "package" | "recur" | "isnot" | "define" | "downcast"
10051005
| "inherit" | "member" | "namespace" | "upcast" | "void" | "lazy" | "include" | "mixin"
10061006
| "protected" | "sealed" | "constructor" | "atomic" | "volatile" | "anyframe" | "anytype"
10071007
| "asm" | "comptime" | "errdefer" | "export" | "opaque" | "orelse" | "resume" | "threadlocal"
10081008
| "unreachable" | "dynclass" | "dynobj" | "dynrec" | "var" | "finally" | "noasync" => {
1009-
format ! ("{name}_")
1009+
format!("{name}_")
10101010
}
1011-
_ => name.to_snake_case(),
1011+
_ => name.strip_prefix("[async]").unwrap_or(name).to_snake_case(),
10121012
}
10131013
}
10141014

0 commit comments

Comments
 (0)