diff --git a/crates/bindings-macro/src/module.rs b/crates/bindings-macro/src/module.rs index 16a2035e351..0e6ff4b3e66 100644 --- a/crates/bindings-macro/src/module.rs +++ b/crates/bindings-macro/src/module.rs @@ -342,7 +342,7 @@ pub(crate) fn derive_deserialize(ty: &SatsType<'_>) -> TokenStream { type Output = __Variant; fn variant_names(&self, names: &mut dyn #spacetimedb_lib::de::ValidNames) { - names.extend([#(#variant_names,)*]) + names.extend::<&[&str]>(&[#(#variant_names,)*]) } fn visit_tag(self, __tag: u8) -> Result { @@ -394,7 +394,10 @@ pub(crate) fn derive_serialize(ty: &SatsType) -> TokenStream { } } }); - quote!(match self { #(#arms)* }) + quote!(match self { + #(#arms)* + _ => unreachable!(), + }) } }; quote! { diff --git a/modules/sdk-test-connect-disconnect-cs/Lib.cs b/modules/sdk-test-connect-disconnect-cs/Lib.cs index 784b87c1f86..216e0d87737 100644 --- a/modules/sdk-test-connect-disconnect-cs/Lib.cs +++ b/modules/sdk-test-connect-disconnect-cs/Lib.cs @@ -29,12 +29,4 @@ public static void Init() new Disconnected { identity = e.Sender }.Insert(); }; } - - [SpacetimeDB.Reducer] - /// Due to a bug in SATS' `derive(Desrialize)` - /// https://github.com/clockworklabs/SpacetimeDB/issues/325 , - /// Rust module bindings fail to compile for modules which define zero reducers - /// (not counting init, update, connect, disconnect). - /// Adding this useless empty reducer causes the module bindings to compile. - public static void UselessEmptyReducer() {} } diff --git a/modules/sdk-test-connect-disconnect/src/lib.rs b/modules/sdk-test-connect-disconnect/src/lib.rs index b661c41ffae..451f065f801 100644 --- a/modules/sdk-test-connect-disconnect/src/lib.rs +++ b/modules/sdk-test-connect-disconnect/src/lib.rs @@ -29,11 +29,3 @@ pub fn identity_connected(ctx: ReducerContext) { pub fn identity_disconnected(ctx: ReducerContext) { Disconnected::insert(Disconnected { identity: ctx.sender }); } - -#[spacetimedb(reducer)] -/// Due to a bug in SATS' `derive(Desrialize)` -/// https://github.com/clockworklabs/SpacetimeDB/issues/325 , -/// Rust module bindings fail to compile for modules which define zero reducers -/// (not counting init, update, connect, disconnect). -/// Adding this useless empty reducer causes the module bindings to compile. -pub fn useless_empty_reducer() {}