mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
fix clippy::map_flatten
This commit is contained in:
parent
62ed658311
commit
d64d711db2
5 changed files with 6 additions and 8 deletions
|
@ -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() + "/")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue