about summary refs log tree commit diff
path: root/src/librustdoc/html/render
diff options
context:
space:
mode:
authorNoah Lev <camelidcamel@gmail.com>2021-12-27 18:57:07 -0800
committerNoah Lev <camelidcamel@gmail.com>2021-12-27 18:57:07 -0800
commit2b801dcdd303e3e2a92e255d8cfb9427800403e5 (patch)
tree4526c678e360cc3c097a48ee53acfdd5bc2f7b73 /src/librustdoc/html/render
parente19593f0e51196dc3528bb5fa8b89e81ae493092 (diff)
downloadrust-2b801dcdd303e3e2a92e255d8cfb9427800403e5.tar.gz
rust-2b801dcdd303e3e2a92e255d8cfb9427800403e5.zip
Move `ExternalLocation` to `clean::types`
It was previously defined in `render::search_index` but wasn't used at
all there. `clean::types` seems like a better fit since that's where
`ExternalCrate` is defined.
Diffstat (limited to 'src/librustdoc/html/render')
-rw-r--r--src/librustdoc/html/render/context.rs4
-rw-r--r--src/librustdoc/html/render/search_index.rs10
2 files changed, 2 insertions, 12 deletions
diff --git a/src/librustdoc/html/render/context.rs b/src/librustdoc/html/render/context.rs
index 6729129027f..534a542d58e 100644
--- a/src/librustdoc/html/render/context.rs
+++ b/src/librustdoc/html/render/context.rs
@@ -14,7 +14,7 @@ use rustc_span::source_map::FileName;
 use rustc_span::symbol::sym;
 
 use super::print_item::{full_path, item_path, print_item};
-use super::search_index::{build_index, ExternalLocation};
+use super::search_index::build_index;
 use super::templates;
 use super::write_shared::write_shared;
 use super::{
@@ -22,7 +22,7 @@ use super::{
     BASIC_KEYWORDS,
 };
 
-use crate::clean::{self, ExternalCrate};
+use crate::clean::{self, types::ExternalLocation, ExternalCrate};
 use crate::config::RenderOptions;
 use crate::docfs::{DocFS, PathError};
 use crate::error::Error;
diff --git a/src/librustdoc/html/render/search_index.rs b/src/librustdoc/html/render/search_index.rs
index 5d4df3ee5ff..787f047790a 100644
--- a/src/librustdoc/html/render/search_index.rs
+++ b/src/librustdoc/html/render/search_index.rs
@@ -13,16 +13,6 @@ use crate::formats::item_type::ItemType;
 use crate::html::markdown::short_markdown_summary;
 use crate::html::render::{IndexItem, IndexItemFunctionType, RenderType, TypeWithKind};
 
-/// Indicates where an external crate can be found.
-crate enum ExternalLocation {
-    /// Remote URL root of the external crate
-    Remote(String),
-    /// This external crate can be found in the local doc/ folder
-    Local,
-    /// The external crate could not be found.
-    Unknown,
-}
-
 /// Builds the search index from the collected metadata
 crate fn build_index<'tcx>(krate: &clean::Crate, cache: &mut Cache, tcx: TyCtxt<'tcx>) -> String {
     let mut defid_to_pathid = FxHashMap::default();