From 98350a0aaefe153366a66c61fc70c1d601f46880 Mon Sep 17 00:00:00 2001 From: Ben Dean-Kawamura Date: Thu, 26 Oct 2023 20:14:27 -0400 Subject: [PATCH] Make the ext-types proc-macro tests pass again This started failing because of #1809. I don't think that's a new issue, but somehow the changes in this branch caused the tests to start failing. Removing this extra function, which I didn't mean to commit in the first place, makes the tests pass. Let's fix it for real in another branch. --- fixtures/ext-types/uniffi-one/src/lib.rs | 5 ----- uniffi_bindgen/src/bindings/python/templates/EnumTemplate.py | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/fixtures/ext-types/uniffi-one/src/lib.rs b/fixtures/ext-types/uniffi-one/src/lib.rs index 4bf130ad02..cf905f48b4 100644 --- a/fixtures/ext-types/uniffi-one/src/lib.rs +++ b/fixtures/ext-types/uniffi-one/src/lib.rs @@ -34,9 +34,4 @@ fn get_my_proc_macro_type(t: UniffiOneProcMacroType) -> UniffiOneProcMacroType { t } -#[uniffi::export] -async fn get_uniffi_one_async() -> UniffiOneEnum { - UniffiOneEnum::One -} - uniffi::include_scaffolding!("uniffi-one"); diff --git a/uniffi_bindgen/src/bindings/python/templates/EnumTemplate.py b/uniffi_bindgen/src/bindings/python/templates/EnumTemplate.py index 8f0989e634..2a347f873e 100644 --- a/uniffi_bindgen/src/bindings/python/templates/EnumTemplate.py +++ b/uniffi_bindgen/src/bindings/python/templates/EnumTemplate.py @@ -81,6 +81,7 @@ def read(buf): {%- endfor %} raise InternalError("Raw enum value doesn't match any cases") + @staticmethod def check(value): {%- if e.variants().is_empty() %} pass @@ -98,6 +99,7 @@ def check(value): {%- endfor %} {%- endif %} + @staticmethod def write(value, buf): {%- for variant in e.variants() %} {%- if e.is_flat() %}