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 committed May 3, 2020
1 parent a034df8 commit 94bddd4
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 @@ -50,9 +50,11 @@ pub mod json {
use serde_json::value::RawValue as JsonRawValue;
use serde_json::Value as JsonValue;
use std::ops::Deref;
use serde::{Serialize, Deserialize};

#[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 94bddd4

Please sign in to comment.