From: Felix Ableitner Date: Thu, 19 Mar 2020 18:01:01 +0000 (+0100) Subject: Adjust for updated Rust version X-Git-Url: http://these/git/%7B%60%24%7BwebArchiveUrl%7D/%22%7B%7D/readmes/%22https:/hacktivis.me/%7Bsrc%7D?a=commitdiff_plain;h=875545f7e1ac5583fe2e2ed92e6d728a06a1114a;p=lemmy.git Adjust for updated Rust version --- diff --git a/server/src/routes/webfinger.rs b/server/src/routes/webfinger.rs index 33e3a48e..7590cb43 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