From aadd90854d2e23e64818bf2e899770f4c3bbde32 Mon Sep 17 00:00:00 2001 From: Dan Burkert Date: Fri, 2 Oct 2020 15:56:42 -0700 Subject: [PATCH] derive Clone, PartialEq and Eq for postgres_types::Json It's a bit unwieldy using the `Json` type in structs without this. `Json` is 'just data', so I think it's usually appropriate to consider instances to be cloneable and testable for equivalence. --- postgres-types/src/serde_json_1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres-types/src/serde_json_1.rs b/postgres-types/src/serde_json_1.rs index e5183d3f..e0fecb49 100644 --- a/postgres-types/src/serde_json_1.rs +++ b/postgres-types/src/serde_json_1.rs @@ -8,7 +8,7 @@ use std::fmt::Debug; use std::io::Read; /// A wrapper type to allow arbitrary `Serialize`/`Deserialize` types to convert to Postgres JSON values. -#[derive(Debug)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Json(pub T); impl<'a, T> FromSql<'a> for Json