Skip to content

Commit 22ac7cd

Browse files
committed
Add a serde_json::Value -> Body conversion
1 parent aeb1fb4 commit 22ac7cd

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)