Skip to content

Commit 9e15c20

Browse files
committed
Simplify json deserialization slightly
1 parent ca211a9 commit 9e15c20

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/tests/util/response.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ where
106106
Ok(body.len())
107107
);
108108

109-
let s = std::str::from_utf8(&body).unwrap();
110-
match serde_json::from_str(s) {
109+
match serde_json::from_slice(&*body) {
111110
Ok(t) => t,
112-
Err(e) => panic!("failed to decode: {:?}\n{}", e, s),
111+
Err(e) => panic!("failed to decode: {:?}", e),
113112
}
114113
}

0 commit comments

Comments
 (0)