Skip to content

Commit

Permalink
serde_json::Value -> Json
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf committed Sep 2, 2023
1 parent df19cbe commit 02f8367
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ensemble/src/types/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ impl FromStr for Json {
}
}

impl From<Value> for Json {
fn from(value: Value) -> Self {
Self(value)
}
}

impl<T: Serialize + DeserializeOwned> Serialize for Json<T> {
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
use serde::ser::Error;
Expand Down

0 comments on commit 02f8367

Please sign in to comment.