From 68f4a68bc133aeaf2732c171f01013e15e54111d Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 21 Aug 2019 10:15:42 +0200 Subject: [PATCH] formatting cleanup Signed-off-by: Wolfgang Bumiller --- api-test/src/bin/api-test.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/api-test/src/bin/api-test.rs b/api-test/src/bin/api-test.rs index 214bc6e7..2dbff9a9 100644 --- a/api-test/src/bin/api-test.rs +++ b/api-test/src/bin/api-test.rs @@ -199,20 +199,18 @@ async fn route_request(request: Request) -> Result, E if let Some(ty) = parts.headers.get(http::header::CONTENT_TYPE) { if ty.to_str()? == "application/json" { use futures::stream::TryStreamExt; - let json = serde_json::from_str(std::str::from_utf8( - body - .try_concat() - .await? - .as_ref() - )?)?; + let json = + serde_json::from_str(std::str::from_utf8(body.try_concat().await?.as_ref())?)?; match json { - Value::Object(map) => for (k, v) in map { - let existed = params - .get_or_insert_with(serde_json::Map::new) - .insert(k, v) - .is_some(); - if existed { - bail!("tried to override path-based parameter!"); + Value::Object(map) => { + for (k, v) in map { + let existed = params + .get_or_insert_with(serde_json::Map::new) + .insert(k, v) + .is_some(); + if existed { + bail!("tried to override path-based parameter!"); + } } } _ => bail!("expected a json object"),