fix: Specta remote implementation for Channel (#10435)

* Update channel.rs
* Don't rely on `DataType` reexport
This commit is contained in:
Oscar Beaumont 2024-08-01 15:26:52 +08:00 committed by GitHub
parent 24445d71de
commit 6755af2302
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 2 deletions

View File

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

View File

@ -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>);
};

View File

@ -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> {