From daf6bed23abc2c51cb0a6b8b9984562979c24301 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Sun, 24 Apr 2022 22:12:31 +0000 Subject: [PATCH] no let --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index bce8df08..d6802ad0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -211,15 +211,17 @@ impl Web3ProxyState { let client = self.client.clone(); let json_body = json_body.clone(); tokio::spawn(async move { - // TODO: there has to be a better way to do this map. i think maybe put the map outside this spawn? - let resp = client + // TODO: there has to be a better way to do this map and map_err + client .post(&url) .json(&json_body) .send() .await - .map_err(|e| (url.clone(), e))?; - resp.text() + // add the url to the error so that we can decrement + .map_err(|e| (url.clone(), e))? + .text() .await + // add the url to the result and the error so that we can decrement .map(|t| (url.clone(), t)) .map_err(|e| (url, e)) })