Skip to content

Commit 1b6e2c1

Browse files
authored
Merge pull request #146 from jbr/json-into-body
Add a serde_json::Value -> Body conversion
2 parents c1ad934 + 22ac7cd commit 1b6e2c1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/body.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,12 @@ impl Debug for Body {
416416
}
417417
}
418418

419+
impl From<serde_json::Value> for Body {
420+
fn from(json_value: serde_json::Value) -> Self {
421+
Self::from_json(&json_value).unwrap()
422+
}
423+
}
424+
419425
impl From<String> for Body {
420426
fn from(s: String) -> Self {
421427
Self::from_string(s)

0 commit comments

Comments
 (0)