Skip to content

Commit

Permalink
Derive Serialize and Deserialize for Json
Browse files Browse the repository at this point in the history
  • Loading branch information
meh authored and mehcode committed May 6, 2020
1 parent a034df8 commit 7b1cc7f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sqlx-core/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ pub mod json {
use crate::decode::Decode;
use crate::encode::Encode;
use crate::value::HasRawValue;
use serde::{Deserialize, Serialize};
use serde_json::value::RawValue as JsonRawValue;
use serde_json::Value as JsonValue;
use std::ops::Deref;

#[cfg_attr(docsrs, doc(cfg(feature = "json")))]
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct Json<T>(pub T);

impl<T> Deref for Json<T> {
Expand Down

0 comments on commit 7b1cc7f

Please sign in to comment.