Skip to content

Conversation

@Thundernerd
Copy link
Owner

Proposed changes

Added a way for doing null checks and getting the contained value with two shorthands:

  • TryGetValue(out value)
  • IsDefined(out value)

TryGetValue points to IsDefined so they are functionally the same, just different names.

Types of changes

Put an x in the boxes that apply.

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (no functional changes, no api changes)
  • Code style update (formatting, renaming)
  • Build related changes (workflow changes)
  • Documentation Update (readme, changelog)
  • Other, please describe:

Issue

#33

What is the current behavior?

Currently you will have to do manual checks on the wrapper, and then on the contained value.

What is the new behavior?

The new behaviour supports calling IsDefined(out value); or TryGetValue(out value); as shorthands for the current behaviour.

Checklist

Put an x in the boxes that apply.

  • The code compiles
  • I have tested that this doesn't break existing code (unless it is an explicit breaking change)
  • I have tested that the (new) functionality/fix works as intended
  • I have added necessary documentation (if appropriate)

@Thundernerd Thundernerd merged commit a51f7b6 into main Aug 2, 2022
@Thundernerd Thundernerd deleted the feature/getting_value branch August 2, 2022 13:41
@Thundernerd
Copy link
Owner Author

🎉 This PR is included in version 1.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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