Adjust for updated Rust version

This commit is contained in:
Felix Ableitner 2020-03-19 19:01:01 +01:00
parent 5976006859
commit 6836f26d9a

View file

@ -46,13 +46,9 @@ async fn get_webfinger_response(
let regex_parsed = WEBFINGER_COMMUNITY_REGEX let regex_parsed = WEBFINGER_COMMUNITY_REGEX
.captures(&info.resource) .captures(&info.resource)
.map(|c| c.get(1)); .map(|c| c.get(1))
// TODO: replace this with .flatten() once we are running rust 1.40 .flatten();
let regex_parsed_flattened = match regex_parsed { let community_name = match regex_parsed {
Some(s) => s,
None => None,
};
let community_name = match regex_parsed_flattened {
Some(c) => c.as_str(), Some(c) => c.as_str(),
None => return Err(format_err!("not_found")), None => return Err(format_err!("not_found")),
}; };
@ -79,7 +75,6 @@ async fn get_webfinger_response(
{ {
"rel": "self", "rel": "self",
"type": "application/activity+json", "type": "application/activity+json",
// Yes this is correct, this link doesn't include the `.json` extension
"href": community_url "href": community_url
} }
// TODO: this also needs to return the subscribe link once that's implemented // TODO: this also needs to return the subscribe link once that's implemented