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

Add an ensure_whatever macro. #330

Merged
merged 1 commit into from May 3, 2022
Merged

Add an ensure_whatever macro. #330

merged 1 commit into from May 3, 2022

Conversation

shepmaster
Copy link
Owner

This is a combination of ensure and whatever.

Closes #328

This is a combination of `ensure` and `whatever`.

Closes #328
@shepmaster shepmaster added the enhancement New feature or request label May 1, 2022
@netlify
Copy link

netlify bot commented May 1, 2022

Deploy Preview for shepmaster-snafu ready!

Name Link
🔨 Latest commit 0665bb3
🔍 Latest deploy log https://app.netlify.com/sites/shepmaster-snafu/deploys/626ed652ed55da0008f523f0
😎 Deploy Preview https://deploy-preview-330--shepmaster-snafu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

/// fn get_bank_account_balance(account_id: &str) -> Result<u8> {
/// # fn moon_is_rising() -> bool { false }
/// ensure_whatever!(
/// moon_is_rising(),
Copy link

Choose a reason for hiding this comment

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

Was it intended to negate the condition? If I'm not mistaken, this changes it from if moon_is_rising() to (after macro expansion) if !moon_is_rising().

Copy link
Owner Author

Choose a reason for hiding this comment

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

Not intended, per se, but I’m ok with it. Since it’s just an example, whatever shows the feature easiest is a good choice, IMO. I don’t expect anyone will remember the example from one version to the next 😅

@shepmaster shepmaster merged commit f679939 into main May 3, 2022
@shepmaster shepmaster deleted the ensure_whatever branch May 3, 2022 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

how to combine ensure! and whatever!
2 participants