MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / to_rust

Method to_rust

bindings/frankenswig/function.py:20–29  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

18 return f'''{doxygen(self.docs)}{self.type.to_c()} {self.name}({', '.join(a.to_c() for a in self.args)});\n'''
19
20 def to_rust(self):
21 result = s(f'''\
22 #[no_mangle]
23 pub extern "C" fn {self.name}({', '.join(a.to_rust() for a in self.args)}) -> {self.type.rust} {{
24 let _default: {self.type.rust} = {self.type.default};
25 '''
26 )
27 result += s(self.body, indent=4)
28 result += '\n}\n'
29 return result
30
31 @staticmethod
32 def pyentry(type, args, pyname, docs):

Callers

nothing calls this directly

Calls 1

sFunction · 0.85

Tested by

no test coverage detected