Moved the `make_item_keywords` function to `context.rs` as it is only used there

This commit is contained in:
Nicholas-Baron 2021-02-13 23:03:07 -08:00
parent 6c7d7a6bf4
commit 14983b9812
2 changed files with 6 additions and 5 deletions

View File

@ -17,8 +17,8 @@ use rustc_span::symbol::sym;
use super::cache::{build_index, ExternalLocation};
use super::print_item::{full_path, item_path, print_item};
use super::{
make_item_keywords, print_sidebar, settings, write_shared, AllTypes, NameDoc, SharedContext,
StylePath, BASIC_KEYWORDS, CURRENT_DEPTH, INITIAL_IDS,
print_sidebar, settings, AllTypes, NameDoc, SharedContext, StylePath, BASIC_KEYWORDS,
CURRENT_DEPTH, INITIAL_IDS,
};
use crate::clean::{self, AttributesExt};
@ -610,3 +610,7 @@ impl<'tcx> FormatRenderer<'tcx> for Context<'tcx> {
&self.cache
}
}
fn make_item_keywords(it: &clean::Item) -> String {
format!("{}, {}", BASIC_KEYWORDS, it.name.as_ref().unwrap())
}

View File

@ -2924,9 +2924,6 @@ fn sidebar_foreign_type(cx: &Context<'_>, buf: &mut Buffer, it: &clean::Item) {
crate const BASIC_KEYWORDS: &str = "rust, rustlang, rust-lang";
fn make_item_keywords(it: &clean::Item) -> String {
format!("{}, {}", BASIC_KEYWORDS, it.name.as_ref().unwrap())
}
/// Returns a list of all paths used in the type.
/// This is used to help deduplicate imported impls