From 6836f26d9a6967252b6756d2a8ff8d90188e4f16 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Thu, 19 Mar 2020 19:01:01 +0100 Subject: [PATCH] Adjust for updated Rust version --- server/src/routes/webfinger.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/server/src/routes/webfinger.rs b/server/src/routes/webfinger.rs index 33e3a48e6..7590cb435 100644 --- a/server/src/routes/webfinger.rs +++ b/server/src/routes/webfinger.rs @@ -46,13 +46,9 @@ async fn get_webfinger_response( let regex_parsed = WEBFINGER_COMMUNITY_REGEX .captures(&info.resource) - .map(|c| c.get(1)); - // TODO: replace this with .flatten() once we are running rust 1.40 - let regex_parsed_flattened = match regex_parsed { - Some(s) => s, - None => None, - }; - let community_name = match regex_parsed_flattened { + .map(|c| c.get(1)) + .flatten(); + let community_name = match regex_parsed { Some(c) => c.as_str(), None => return Err(format_err!("not_found")), }; @@ -79,7 +75,6 @@ async fn get_webfinger_response( { "rel": "self", "type": "application/activity+json", - // Yes this is correct, this link doesn't include the `.json` extension "href": community_url } // TODO: this also needs to return the subscribe link once that's implemented