Skip to content

Make Value fully constructible#171

Merged
suharev7 merged 1 commit intosuharev7:async-awaitfrom
scrabsha:make-value-constructible
May 5, 2022
Merged

Make Value fully constructible#171
suharev7 merged 1 commit intosuharev7:async-awaitfrom
scrabsha:make-value-constructible

Conversation

@scrabsha
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants