From 3f6a4096f885db05387f3d361b6306fe8e299b93 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Tue, 21 Apr 2020 16:48:54 -0400 Subject: [PATCH] Fixing closures. --- server/src/routes/api.rs | 2 +- server/src/routes/feeds.rs | 4 ++-- server/src/routes/nodeinfo.rs | 2 +- server/src/routes/webfinger.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/routes/api.rs b/server/src/routes/api.rs index 5ff53e270..1565afb80 100644 --- a/server/src/routes/api.rs +++ b/server/src/routes/api.rs @@ -158,7 +158,7 @@ where let res = web::block(move || oper.perform(db.get_ref().to_owned(), Some(ws_info))) .await .map(|json| HttpResponse::Ok().json(json)) - .map_err(|e| ErrorBadRequest(e))?; + .map_err(ErrorBadRequest)?; Ok(res) } diff --git a/server/src/routes/feeds.rs b/server/src/routes/feeds.rs index b36755358..815953c55 100644 --- a/server/src/routes/feeds.rs +++ b/server/src/routes/feeds.rs @@ -39,7 +39,7 @@ async fn get_all_feed( .content_type("application/rss+xml") .body(rss) }) - .map_err(|e| ErrorBadRequest(e))?; + .map_err(ErrorBadRequest)?; Ok(res) } @@ -100,7 +100,7 @@ async fn get_feed( .content_type("application/rss+xml") .body(rss) }) - .map_err(|e| ErrorBadRequest(e))?; + .map_err(ErrorBadRequest)?; Ok(res) } diff --git a/server/src/routes/nodeinfo.rs b/server/src/routes/nodeinfo.rs index 97863271b..9ade80283 100644 --- a/server/src/routes/nodeinfo.rs +++ b/server/src/routes/nodeinfo.rs @@ -49,7 +49,7 @@ async fn node_info( }) .await .map(|json| HttpResponse::Ok().json(json)) - .map_err(|e| ErrorBadRequest(e))?; + .map_err(ErrorBadRequest)?; Ok(res) } diff --git a/server/src/routes/webfinger.rs b/server/src/routes/webfinger.rs index f39c6b67b..eaab1cb8c 100644 --- a/server/src/routes/webfinger.rs +++ b/server/src/routes/webfinger.rs @@ -84,6 +84,6 @@ async fn get_webfinger_response( }) .await .map(|json| HttpResponse::Ok().json(json)) - .map_err(|e| ErrorBadRequest(e))?; + .map_err(ErrorBadRequest)?; Ok(res) }