Skip to content

Conversation

oguzkocer
Copy link
Contributor

Builds on #85. We use custom parsers that we export through UniFFI, so consumers can use the correct parser for the response type. However, all our parsers' signatures are identical, with the only change being the return type and it adds a lot of boilerplate.

This PR introduces the convenience macro add_uniffi_exported_parser! that generates these functions - we just need to pass a name and return type to it. Besides the decreased noise in the code, this should help us ensure that we are building our parsers in a consistent manner.

Note that this will not result in any change to the code that we are executing, it's just a syntactic sugar.

@oguzkocer oguzkocer added the Rust label May 15, 2024
@oguzkocer oguzkocer added this to the 0.1 milestone May 15, 2024
Base automatically changed from generic-parse-wp-response to trunk May 15, 2024 19:54
@jkmassel jkmassel force-pushed the add_uniffi_exported_parser branch from 998e13b to eb2169d Compare May 15, 2024 19:57
@oguzkocer oguzkocer enabled auto-merge (squash) May 15, 2024 19:59
@oguzkocer oguzkocer merged commit 360e778 into trunk May 15, 2024
@oguzkocer oguzkocer deleted the add_uniffi_exported_parser branch May 15, 2024 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants