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

Make Value fully constructible #171

Merged
merged 1 commit into from
May 5, 2022

Conversation

scrabsha
Copy link
Contributor

@scrabsha scrabsha commented May 5, 2022

Previous implementation of the Value enum used a hand-crafted Either
enum in order to represent values that can either be null (the Left
variant) or non-null value (the Right) variant.

The problem is that this enum was not exposed in the public API. As
such, it was impossible for clickhouse_rs users to build
Value::Nullable(...) values.

This commit fixes the problem by removing the Either datatype from the
codebase and using the either crate instead, hence making every
variant of Value constructible!

Previous implementation of the `Value` enum used a hand-crafted `Either`
enum in order to represent values that can either be null (the `Left`
variant) or non-null value (the `Right`) variant.

The problem is that this enum was not exposed in the public API. As
such, it was impossible for `clickhouse_rs` users to build
`Value::Nullable(...)` values.

This commit fixes the problem by removing the `Either` datatype from the
codebase and using the [`either`] crate instead, hence making every
variant of `Value` constructible!

[`either`]: https://docs.rs/either/1.6.1/either/index.html
@suharev7
Copy link
Owner

suharev7 commented May 5, 2022

Thank a lot

@suharev7 suharev7 merged commit c61904a into suharev7:async-await May 5, 2022
@scrabsha scrabsha deleted the make-value-constructible branch May 5, 2022 22:05
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.

None yet

2 participants