Cleanup keyword handling in CodegenRust.py

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
Simon Wülker 2025-05-25 17:32:48 +02:00
parent 0258783df8
commit 774a9f3769

View file

@ -6761,10 +6761,9 @@ class CGInterfaceTrait(CGThing):
yield name, arguments, rettype, False
def fmt(arguments, leadingComma=True):
keywords = {"async"}
prefix = "" if not leadingComma else ", "
return prefix + ", ".join(
f"{name if name not in keywords else f'r#{name}'}: {type_}"
f"r#{name}: {type_}"
for name, type_ in arguments
)