From: Dessalines Date: Tue, 21 Apr 2020 20:48:54 +0000 (-0400) Subject: Fixing closures. X-Git-Url: http://these/git/%22https:/image.com/%22%7B%7D/static/%7Bicon?a=commitdiff_plain;h=809cc1049e5c50e7352f2df3d6fe1829558fdec7;p=lemmy.git Fixing closures. --- 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) }