Skip to content

Add valueOr for PBOption#71

Merged
nitely merged 3 commits into
status-im:masterfrom
nitely:pboptional_get_helper
Apr 20, 2026
Merged

Add valueOr for PBOption#71
nitely merged 3 commits into
status-im:masterfrom
nitely:pboptional_get_helper

Conversation

@nitely
Copy link
Copy Markdown
Contributor

@nitely nitely commented Apr 20, 2026

Changes:

  • Add valueOr*(opt: PBOption, def: untyped): untyped

This is a helper to avoid if opt.field.isSome: opt.field.get() else: myValue. Ideally the default would be set in the proto definition, but some applications may want to get a different default depending on the case.

@nitely nitely changed the title Add PBOption get with default param Add get PBOption with default param Apr 20, 2026
@nitely nitely changed the title Add get PBOption with default param Add valueOr for PBOption Apr 20, 2026
@nitely nitely marked this pull request as ready for review April 20, 2026 18:51
@nitely nitely merged commit 4619854 into status-im:master Apr 20, 2026
28 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.

1 participant