Adjust for updated Rust version

pull/722/head
Felix Ableitner 2020-03-19 19:01:01 +01:00
parent 672798e711
commit 875545f7e1
1 changed files with 3 additions and 8 deletions

View File

@ -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