Skip to content

How to return {:ok, result} from say NifResult<Type>? #660

Answered by filmor
jonmdev asked this question in Q&A
Discussion options

You must be logged in to vote

It's not a bug, you have to adjust the return type if you are returning a different type. The compiler tells you. So, change NifResult<String> to NifResult<(Atom, String>. Using a bare Result is likely the better option, though.

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@jonmdev
Comment options

Comment options

You must be logged in to vote
1 reply
@jonmdev
Comment options

Comment options

You must be logged in to vote
3 replies
@jonmdev
Comment options

@filmor
Comment options

Answer selected by jonmdev
@jonmdev
Comment options

Comment options

You must be logged in to vote
1 reply
@jonmdev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #659 on October 16, 2024 08:54.