-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
bugfix: fix #36 by type-casting errors
Produces code like this: ``` func (foreignCallbackCallbackInterfaceCallback) InvokeDoSomething(callback Callback, args []byte, outBuf *C.RustBuffer) uniffiCallbackResult { reader := bytes.NewReader(args) callback.DoSomething(FfiConverterTypeBoobyTrapErrorINSTANCE.Read(reader).(*BoobyTrapError)) return uniffiCallbackResultSuccess } func (foreignCallbackCallbackInterfaceCallback) InvokeDoSomethingElse(callback Callback, args []byte, outBuf *C.RustBuffer) uniffiCallbackResult { reader := bytes.NewReader(args) callback.DoSomethingElse(FfiConverterTypeSomeEnumINSTANCE.Read(reader)) return uniffiCallbackResultSuccess } ``` Note the type-cast on `Read(reader)` for errors. Signed-off-by: Kegan Dougal <[email protected]>
Showing
5 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters