From f16125537291ad5c727be49dcee08beeda337b0b Mon Sep 17 00:00:00 2001 From: "J. Simon Richard" Date: Thu, 6 Jun 2024 12:36:57 -0400 Subject: [PATCH] Allow paths in collect_events macro --- examples/app/src-tauri/src/main.rs | 2 +- src/event.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/app/src-tauri/src/main.rs b/examples/app/src-tauri/src/main.rs index ba3d4cd..66d5f7a 100644 --- a/examples/app/src-tauri/src/main.rs +++ b/examples/app/src-tauri/src/main.rs @@ -127,7 +127,7 @@ fn main() { typesafe_errors_using_thiserror, typesafe_errors_using_thiserror_with_value ]) - .events(tauri_specta::collect_events![DemoEvent, EmptyEvent]) + .events(tauri_specta::collect_events![crate::DemoEvent, EmptyEvent]) .types(TypeCollection::default().register::()) .config(specta::ts::ExportConfig::default().formatter(specta::ts::formatter::prettier)) .types(TypeCollection::default().register::()) diff --git a/src/event.rs b/src/event.rs index 27f4bea..c85de65 100644 --- a/src/event.rs +++ b/src/event.rs @@ -186,7 +186,7 @@ pub type CollectEventsTuple = (EventCollection, Vec, specta::Type #[macro_export] macro_rules! collect_events { - ($($event:ident),* $(,)?) => {{ + ($($event:path),* $(,)?) => {{ let mut collection: $crate::EventCollection = ::core::default::Default::default(); $(collection.register::<$event>();)*