Skip to content

Commit

Permalink
Derive Debug, Clone and PartialEq for ValueOpt (#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
aljazerzen authored Jul 10, 2024
1 parent 89662fd commit 2333cc5
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion edgedb-protocol/src/client_message.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
([Website reference](https://www.edgedb.com/docs/reference/protocol/messages)) The [ClientMessage](crate::client_message::ClientMessage) enum and related types.
([Website reference](https://www.edgedb.com/docs/reference/protocol/messages)) The [ClientMessage] enum and related types.
```rust,ignore
pub enum ClientMessage {
Expand Down
2 changes: 1 addition & 1 deletion edgedb-protocol/src/codec.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Implementations of the [Codec](crate::codec::Codec) trait into types found in the [Value](crate::value::Value) enum.
Implementations of the [Codec] trait into types found in the [Value] enum.
*/

use std::any::type_name;
Expand Down
2 changes: 1 addition & 1 deletion edgedb-protocol/src/descriptors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
([Website reference](https://www.edgedb.com/docs/reference/protocol/typedesc)) Types for the [Descriptor](crate::descriptors::Descriptor) enum.
([Website reference](https://www.edgedb.com/docs/reference/protocol/typedesc)) Types for the [Descriptor] enum.
```rust,ignore
pub enum Descriptor {
Expand Down
4 changes: 2 additions & 2 deletions edgedb-protocol/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*!
([Website reference](https://www.edgedb.com/docs/reference/protocol/index)) The EdgeDB protocol for Edgedb-Rust.
EdgeDB types used for data modeling can be seen on the [model](crate::model) crate, in which the [Value](crate::value::Value)
EdgeDB types used for data modeling can be seen on the [model] crate, in which the [Value](crate::value::Value)
enum provides the quickest overview of all the possible types encountered using the client. Many of the variants hold Rust
standard library types while others contain types defined in this protocol. Some types such as [Duration](crate::model::Duration)
appear to be standard library types but are unique to the EdgeDB protocol.
Expand All @@ -12,7 +12,7 @@ for working with the client such as:
* [QueryArg](crate::query_arg::QueryArg): a single argument for a query
* [QueryArgs](crate::query_arg::QueryArgs): a tuple of query arguments
* [Queryable](crate::queryable::Queryable): for the Queryable derive macro
* [QueryResult](crate::query_result::QueryResult): single result from a query (scalars and tuples)
* [QueryResult]: single result from a query (scalars and tuples)
The Value enum:
Expand Down
2 changes: 1 addition & 1 deletion edgedb-protocol/src/query_arg.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Contains the [QueryArg](crate::query_arg::QueryArg) and [QueryArgs](crate::query_arg::QueryArgs) traits.
Contains the [QueryArg] and [QueryArgs] traits.
*/

use std::convert::{TryFrom, TryInto};
Expand Down
2 changes: 1 addition & 1 deletion edgedb-protocol/src/queryable.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Contains the [Queryable](crate::queryable::Queryable) trait.
Contains the [Queryable] trait.
*/
use snafu::{ensure, Snafu};
use std::default::Default;
Expand Down
2 changes: 1 addition & 1 deletion edgedb-protocol/src/server_message.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
The [ServerMessage](crate::server_message::ServerMessage) enum and related types. EdgeDB website documentation on messages [here](https://www.edgedb.com/docs/reference/protocol/messages).
The [ServerMessage] enum and related types. EdgeDB website documentation on messages [here](https://www.edgedb.com/docs/reference/protocol/messages).
```rust,ignore
pub enum ServerMessage {
Expand Down
2 changes: 1 addition & 1 deletion edgedb-protocol/src/value.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
Contains the [Value](crate::value::Value) enum.
Contains the [Value] enum.
*/
use bytes::Bytes;

Expand Down
3 changes: 2 additions & 1 deletion edgedb-protocol/src/value_opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ use crate::value::Value;
/// An optional [Value] that can be constructed from `impl Into<Value>`,
/// `Option<impl Into<Value>>`, `Vec<impl Into<Value>>` or
/// `Option<Vec<impl Into<Value>>>`.
/// Used by [eargs!] macro.
/// Used by [named_args!](`crate::named_args!`) macro.
#[derive(Clone, Debug, PartialEq)]
pub struct ValueOpt(Option<Value>);

impl<V: Into<Value>> From<V> for ValueOpt {
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
buildInputs = [
(fenix_pkgs.toolchainOf {
channel = "beta";
sha256 = "sha256-WtTNSmxfoiHJEwCUnuDNfRNBZjNrzdBV02Hikw+YE+s=";
sha256 = "sha256-q7N1YC9mppPme25wjb81cuOgDXFCkA10Lb1D1GCDv04=";
}).defaultToolchain
] ++ common;
};
Expand Down

0 comments on commit 2333cc5

Please sign in to comment.