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.
This commit is contained in:
Dan Burkert 2020-10-02 15:56:42 -07:00
parent 587193f61a
commit aadd90854d

View File

@ -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<T>(pub T);
impl<'a, T> FromSql<'a> for Json<T>