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

Method to_rust

bindings/frankenswig/enums.py:17–22  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

15 return self
16
17 def to_rust(self):
18 start = f'#[repr(C)]\n#[derive(Copy, Clone)]\npub enum {self.c_name} {{\n'
19 internal = '\n'.join(f'{name} = {val},' for (name, val) in self.variants)
20 end = '\n}\n'
21
22 return start + s(internal, indent=4) + end
23
24 def to_c(self):
25 start = f'{doxygen(self.docs)}typedef enum {self.c_name} {{\n'

Callers 1

to_rustMethod · 0.45

Calls 1

sFunction · 0.85

Tested by

no test coverage detected