fix clippy::map_flatten

This commit is contained in:
Matthias Krüger 2022-03-12 14:26:16 +01:00
parent 62ed658311
commit d64d711db2
5 changed files with 6 additions and 8 deletions

View file

@ -231,7 +231,7 @@ impl Crate {
return None;
}
let doc_url = doc_attr_q.tt_values().map(|tt| {
let doc_url = doc_attr_q.tt_values().filter_map(|tt| {
let name = tt.token_trees.iter()
.skip_while(|tt| !matches!(tt, TokenTree::Leaf(Leaf::Ident(Ident { text, ..} )) if text == "html_root_url"))
.nth(2);
@ -240,7 +240,7 @@ impl Crate {
Some(TokenTree::Leaf(Leaf::Literal(Literal{ref text, ..}))) => Some(text),
_ => None
}
}).flatten().next();
}).next();
doc_url.map(|s| s.trim_matches('"').trim_end_matches('/').to_owned() + "/")
}