Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
-rw-r--r--crates/hir/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index d83fb16d10..0417196843 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -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() + "/")
}