Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Moved the make_item_keywords function to context.rs as it is only…
… used there
  • Loading branch information
Nicholas-Baron committed Mar 4, 2021
commit 14983b9812e67a283587b651c0a14e1d4e1ab723
8 changes: 6 additions & 2 deletions src/librustdoc/html/render/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -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())
}
3 changes: 0 additions & 3 deletions src/librustdoc/html/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down