From 809cc1049e5c50e7352f2df3d6fe1829558fdec7 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 5ff53e27..1565afb8 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 b3675535..815953c5 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 97863271..9ade8028 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 f39c6b67..eaab1cb8 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) } -- 2.44.1