oscartbeaumont / tauri-specta

Completely typesafe Tauri commands
MIT License
291 stars 27 forks source link

`mut` keyword included in command argument #24

Closed probablykasper closed 1 year ago

probablykasper commented 1 year ago

This command:

#[command]
#[specta::specta]
pub async fn new_group(mut group: Group) {}

gets this binding:

export function newGroup(mutGroup: Group) {
    return invoke<Group[]>("new_group", { mutGroup })
}
Brendonovich commented 1 year ago

hmmm i'm guessing this is a problem with specta::specta

oscartbeaumont commented 1 year ago

@probablykasper Good spot, this brings up a bigger issue of how we handle Rust destructuring in function args but for now, I am going to forbid that because I think fixing it will be a breaking change in Specta and it's not gonna be long until we do v2 with other breaking changes anyway.

This should be fixed with the latest Specta release if you pull it into your project.

probablykasper commented 1 year ago

Awesome, it works perfectly now! Thank you !!