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 1718630 commit 287c0e4Copy full SHA for 287c0e4
codegen/pyi.rs
@@ -74,10 +74,11 @@ pub fn generator(type_data: &Declarations) -> io::Result<()> {
74
match &item.kind {
75
DeclarationKind::Enum(info) => {
76
for (var_val, var_info) in &info.variants {
77
- write_fmt!(file, " {}: {type_name}", normalize_caps(&var_info.name));
+ let field_name = normalize_caps(&var_info.name);
78
+ write_fmt!(file, " {field_name}: {type_name}");
79
80
write_str!(file, " \"\"\"");
- write_fmt!(file, " self.value = {var_val}");
81
+ write_fmt!(file, " `assert int({type_name}.{field_name}) == {var_val}`");
82
83
if !var_info.docstrings.docstrings.is_empty() {
84
write_str!(file, "");
0 commit comments