Browse Source

fix: Specta remote implementation for `Channel` (#10435)

* Update channel.rs
* Don't rely on `DataType` reexport
Oscar Beaumont 1 year ago
parent
commit
6755af2302
3 changed files with 7 additions and 2 deletions
  1. 5 0
      .changes/change-pr-10435.md
  2. 1 1
      core/tauri/src/ipc/channel.rs
  3. 1 1
      core/tauri/src/lib.rs

+ 5 - 0
.changes/change-pr-10435.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch:bug
+---
+
+Fix Specta remote implementation target for `Channel`.

+ 1 - 1
core/tauri/src/ipc/channel.rs

@@ -46,7 +46,7 @@ pub struct Channel<TSend = InvokeBody> {
 #[cfg(feature = "specta")]
 const _: () = {
   #[derive(specta::Type)]
-  #[specta(remote = Channel, rename = "TAURI_CHANNEL")]
+  #[specta(remote = super::Channel, rename = "TAURI_CHANNEL")]
   struct Channel<TSend>(std::marker::PhantomData<TSend>);
 };
 

+ 1 - 1
core/tauri/src/lib.rs

@@ -992,7 +992,7 @@ pub mod test;
 
 #[cfg(feature = "specta")]
 const _: () = {
-  use specta::{function::FunctionArg, DataType, TypeMap};
+  use specta::{datatype::DataType, function::FunctionArg, TypeMap};
 
   impl<'r, T: Send + Sync + 'static> FunctionArg for crate::State<'r, T> {
     fn to_datatype(_: &mut TypeMap) -> Option<DataType> {