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

Implement 'From<Option>' for 'MaybeUnset' #1221

Conversation

stanislav-tkach
Copy link
Contributor

@stanislav-tkach stanislav-tkach commented Feb 11, 2025

I think it is convenient to simplify conversion from Option<T> to MaybeUnset<T>, but maybe I'm missing something.

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

@wprzytula
Copy link
Collaborator

wprzytula commented Feb 11, 2025

❓ Did you consider that Option::None already represents presence of the CQL null value, which is different from absence of value that MaybeUnset represents?

Copy link

cargo semver-checks found no API-breaking changes in this PR! 🎉🥳
Checked commit: df112a0

@stanislav-tkach
Copy link
Contributor Author

stanislav-tkach commented Feb 11, 2025

@wprzytula
I see, but From conversion is explicit, so I still consider it useful. But feel free to close the pull request if you think it will create confusion.

@wprzytula
Copy link
Collaborator

@wprzytula I see, but From conversion is explicit, so I still consider it useful. But feel free to close the pull request if you think it will create confusion.

I'm in two minds. @Lorak-mmk @muzarski WDYT?

@Lorak-mmk
Copy link
Collaborator

I'm against such conversions. It doesn't save a lot of typing, but it may introduce unwanted behavior.

@stanislav-tkach
Copy link
Contributor Author

Ok, no problem.

@stanislav-tkach stanislav-tkach deleted the from-option-for-maybe-unset branch February 11, 2025 11:25
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.

3 participants