Skip to content

Commit 69deb6d

Browse files
committed
Run the formatter
No other changes.
1 parent 722ee7a commit 69deb6d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

bitreq/src/request.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,8 @@ impl Request {
183183
/// string.
184184
#[cfg(feature = "json-using-serde")]
185185
pub fn with_json<T: serde::ser::Serialize>(mut self, body: &T) -> Result<Request, Error> {
186-
self.headers.insert(
187-
"Content-Type".to_string(),
188-
"application/json; charset=UTF-8".to_string(),
189-
);
186+
self.headers
187+
.insert("Content-Type".to_string(), "application/json; charset=UTF-8".to_string());
190188
match serde_json::to_string(&body) {
191189
Ok(json) => Ok(self.with_body(json)),
192190
Err(err) => Err(Error::SerdeJsonError(err)),

bitreq/tests/main.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@ fn test_json_using_serde() {
2424

2525
setup();
2626
let original_json: serde_json::Value = serde_json::from_str(JSON_SRC).unwrap();
27-
let response = bitreq::post(url("/echo"))
28-
.with_json(&original_json)
29-
.unwrap()
30-
.send()
31-
.unwrap();
27+
let response = bitreq::post(url("/echo")).with_json(&original_json).unwrap().send().unwrap();
3228
let actual_json: serde_json::Value = response.json().unwrap();
3329
assert_eq!(&actual_json, &original_json);
3430
}

0 commit comments

Comments
 (0)