mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Refactor if-else
This commit is contained in:
parent
1ab8c7fd27
commit
f913d4f4b7
1 changed files with 5 additions and 6 deletions
|
@ -64,14 +64,13 @@ pub(crate) fn rewrite_links(db: &RootDatabase, markdown: &str, definition: Defin
|
||||||
// * path-based links: `../../module/struct.MyStruct.html`
|
// * path-based links: `../../module/struct.MyStruct.html`
|
||||||
// * module-based links (AKA intra-doc links): `super::super::module::MyStruct`
|
// * module-based links (AKA intra-doc links): `super::super::module::MyStruct`
|
||||||
if let Some((target, title)) = rewrite_intra_doc_link(db, definition, target, title) {
|
if let Some((target, title)) = rewrite_intra_doc_link(db, definition, target, title) {
|
||||||
return (None, target, title);
|
(None, target, title)
|
||||||
}
|
} else if let Some(target) = rewrite_url_link(db, definition, target) {
|
||||||
if let Some(target) = rewrite_url_link(db, definition, target) {
|
(Some(LinkType::Inline), target, title.to_string())
|
||||||
return (Some(LinkType::Inline), target, title.to_string());
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
(None, target.to_string(), title.to_string())
|
(None, target.to_string(), title.to_string())
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
let mut out = String::new();
|
let mut out = String::new();
|
||||||
cmark_resume_with_options(
|
cmark_resume_with_options(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue