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

[framework] vector zip destroy_empty + allow return values in lambdas #20745

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

damirka
Copy link
Contributor

@damirka damirka commented Dec 27, 2024

Description

  • adds v2.destroy_empty in zip_do to support destroying vectors of non-droppable Ts
  • allows return values in lambdas as a convenience feature to not wrap lambdas into braces

Test plan

  • features tests

Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

@damirka damirka self-assigned this Dec 27, 2024
@damirka damirka temporarily deployed to sui-typescript-aws-kms-test-env December 27, 2024 17:54 — with GitHub Actions Inactive
Copy link

vercel bot commented Dec 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Dec 27, 2024 5:54pm
sui-kiosk ⬜️ Ignored (Inspect) Dec 27, 2024 5:54pm
sui-typescript-docs ⬜️ Ignored (Inspect) Dec 27, 2024 5:54pm

@@ -84,7 +84,7 @@ public macro fun num_to_string($x: _): String {
buffer.to_string()
}

public macro fun range_do($start: _, $stop: _, $f: |_|) {
public macro fun range_do($start: _, $stop: _, $f: |_| -> _) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These changes feel fine to me, I just wonder if it is worth annotating, e.g.

Suggested change
public macro fun range_do($start: _, $stop: _, $f: |_| -> _) {
public macro fun range_do<R: drop>($start: _, $stop: _, $f: |_| -> R) {

Perhaps @tzakian or @cgswords will have opinions

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.

2 participants