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

[uniffi] Turn more types into UniFFI records #120

Merged
merged 3 commits into from
Mar 19, 2024

Conversation

mgeisler
Copy link
Contributor

Issues:

Addresses #81.

Description of changes:

As discussed in #112 (comment) onwards, the Kotlin code generated by UniFFI becomes simpler when we use uniffi::Record instead of uniffi::Object. This PR turns CommitOutput, SignaturePublicKey, SignatureSecretKey, and RatchetTree into records.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT license.

@mgeisler mgeisler requested a review from a team as a code owner March 18, 2024 14:42
stefunctional
stefunctional previously approved these changes Mar 18, 2024
tomleavy
tomleavy previously approved these changes Mar 18, 2024
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 90.00000% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 89.45%. Comparing base (650ed8d) to head (87c1255).
Report is 2 commits behind head on main.

Files Patch % Lines
mls-rs-uniffi/src/lib.rs 90.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #120      +/-   ##
==========================================
+ Coverage   89.34%   89.45%   +0.11%     
==========================================
  Files         173      173              
  Lines       31333    31322      -11     
==========================================
+ Hits        27993    28018      +25     
+ Misses       3340     3304      -36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This simplifies the Kotlin API since records don’t have the `close`
method that objects have. The downside is that creating the record
requires you to eagerly create the data for all record fields.
@mgeisler mgeisler dismissed stale reviews from tomleavy and stefunctional via d5925c1 March 19, 2024 16:10
Copy link
Contributor

@stefunctional stefunctional left a comment

Choose a reason for hiding this comment

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

Thank you!

@mgeisler
Copy link
Contributor Author

Thanks all for the great review! The Clone Wars have been won, no more clone() in this code 😄

@mulmarta mulmarta merged commit 81b190d into awslabs:main Mar 19, 2024
12 checks passed
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.

5 participants