]> git.lizzy.rs Git - rust.git/commitdiff
display_for -> suggestion_for
authorJoshua Nelson <jyn514@gmail.com>
Sat, 29 Aug 2020 19:13:28 +0000 (15:13 -0400)
committerJoshua Nelson <jyn514@gmail.com>
Thu, 3 Sep 2020 13:31:14 +0000 (09:31 -0400)
src/librustdoc/passes/collect_intra_doc_links.rs

index ff3c19da3cf7598dfca3de7f886c37b549719ee4..feadf82a2b57e2e022bf9d14a3c2bc9e9d92a53d 100644 (file)
@@ -685,7 +685,6 @@ fn fold_item(&mut self, mut item: Item) -> Option<Item> {
                 continue;
             }
 
-            //let had_backticks = ori_link.contains("`");
             let link = ori_link.replace("`", "");
             let parts = link.split('#').collect::<Vec<_>>();
             let (link, extra_fragment) = if parts.len() > 2 {
@@ -1053,7 +1052,7 @@ fn from_res(res: Res) -> Self {
     }
 
     /// Return (description of the change, suggestion)
-    fn display_for(self, path_str: &str) -> (&'static str, String) {
+    fn suggestion_for(self, path_str: &str) -> (&'static str, String) {
         const PREFIX: &str = "prefix with the item kind";
         const FUNCTION: &str = "add parentheses";
         const MACRO: &str = "add an exclamation mark";
@@ -1308,7 +1307,7 @@ fn suggest_disambiguator(
     sp: Option<rustc_span::Span>,
     link_range: &Option<Range<usize>>,
 ) {
-    let (action, mut suggestion) = disambiguator.display_for(path_str);
+    let (action, mut suggestion) = disambiguator.suggestion_for(path_str);
     let help = format!("to link to the {}, {}", disambiguator.descr(), action);
 
     if let Some(sp) = sp {