aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/doc_links.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-11-02 16:01:38 +0000
committerGitHub <[email protected]>2020-11-02 16:01:38 +0000
commitcb04f0c019bdd77406a7feb6ae7f4a17924d0693 (patch)
tree5bb833b20c4d66a3683ceeb60a922a86284d5ad6 /crates/ide/src/doc_links.rs
parent731b38fa3c1694648e6c8e60f61820f9783343eb (diff)
parentf5e7f07838975757703a7e00adb45ee43c2d9a1a (diff)
Merge #6440
6440: Deny unreachable pub r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ide/src/doc_links.rs')
-rw-r--r--crates/ide/src/doc_links.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/crates/ide/src/doc_links.rs b/crates/ide/src/doc_links.rs
index 250f10f9f..10263537a 100644
--- a/crates/ide/src/doc_links.rs
+++ b/crates/ide/src/doc_links.rs
@@ -1,7 +1,6 @@
1//! Resolves and rewrites links in markdown documentation. 1//! Resolves and rewrites links in markdown documentation.
2 2
3use std::convert::TryFrom; 3use std::{convert::TryFrom, iter::once};
4use std::iter::once;
5 4
6use itertools::Itertools; 5use itertools::Itertools;
7use pulldown_cmark::{BrokenLink, CowStr, Event, InlineStr, LinkType, Options, Parser, Tag}; 6use pulldown_cmark::{BrokenLink, CowStr, Event, InlineStr, LinkType, Options, Parser, Tag};
@@ -21,10 +20,10 @@ use syntax::{ast, match_ast, AstNode, SyntaxKind::*, SyntaxToken, TokenAtOffset,
21 20
22use crate::{FilePosition, Semantics}; 21use crate::{FilePosition, Semantics};
23 22
24pub type DocumentationLink = String; 23pub(crate) type DocumentationLink = String;
25 24
26/// Rewrite documentation links in markdown to point to an online host (e.g. docs.rs) 25/// Rewrite documentation links in markdown to point to an online host (e.g. docs.rs)
27pub fn rewrite_links(db: &RootDatabase, markdown: &str, definition: &Definition) -> String { 26pub(crate) fn rewrite_links(db: &RootDatabase, markdown: &str, definition: &Definition) -> String {
28 let mut cb = |link: BrokenLink| { 27 let mut cb = |link: BrokenLink| {
29 Some(( 28 Some((
30 /*url*/ link.reference.to_owned().into(), 29 /*url*/ link.reference.to_owned().into(),
@@ -63,7 +62,7 @@ pub fn rewrite_links(db: &RootDatabase, markdown: &str, definition: &Definition)
63} 62}
64 63
65/// Remove all links in markdown documentation. 64/// Remove all links in markdown documentation.
66pub fn remove_links(markdown: &str) -> String { 65pub(crate) fn remove_links(markdown: &str) -> String {
67 let mut drop_link = false; 66 let mut drop_link = false;
68 67
69 let mut opts = Options::empty(); 68 let mut opts = Options::empty();