Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return Results from native function wrappers #1065

Merged

Conversation

akonradi-signal
Copy link
Contributor

This doesn't bubble the Result return type all the way to the top, and it uses the existing status code as the error type instead of defining a new type as suggested in #802 (comment).

Progress on #802

@kjvalencik
Copy link
Member

Woah! This is awesome. Thanks for taking this on.

I notice a lot of let () = .... Is that an artifact of a code mod tool or is that serving a purpose?

@akonradi-signal
Copy link
Contributor Author

It serves the purpose of indicating that there's no additional information like a boolean success value, that needs to be handled.

@akonradi-signal
Copy link
Contributor Author

I should note that it's not required, and I'm happy to remove the let () = s if that doesn't seem useful.

@kjvalencik
Copy link
Member

I think I would prefer removing it. It feels like a technique that would make more sense back before the #[must_use] annotation existed.

Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a great improvement, thank you for doing this!

crates/neon/src/sys/tsfn.rs Show resolved Hide resolved
@akonradi-signal
Copy link
Contributor Author

Rebased on latest main to fix build conflicts

@dherman dherman merged commit 323450a into neon-bindings:main Nov 4, 2024
9 checks passed
@dherman
Copy link
Collaborator

dherman commented Nov 4, 2024

Merged, thank you so much for tackling this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants