diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-03-03 15:53:16 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2020-03-16 18:30:26 +0100 |
| commit | d964e60e4fffc95e8c1aee90badafdc83e9ea421 (patch) | |
| tree | 2c55c21f969fbbf00dfb712b0f82b2dcc26edbd0 | |
| parent | 5654cde729c99f894507141c391e0e8b2311e2fb (diff) | |
| download | rust-d964e60e4fffc95e8c1aee90badafdc83e9ea421.tar.gz rust-d964e60e4fffc95e8c1aee90badafdc83e9ea421.zip | |
Rename render::Type to improve naming
| -rw-r--r-- | src/librustdoc/html/render.rs | 10 | ||||
| -rw-r--r-- | src/librustdoc/html/render/cache.rs | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index d21fdeb492e..9e1e11c54d0 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -302,14 +302,14 @@ impl Serialize for IndexItem { /// A type used for the search index. #[derive(Debug)] -struct Type { +struct RenderType { ty: Option<DefId>, idx: Option<usize>, name: Option<String>, generics: Option<Vec<Generic>>, } -impl Serialize for Type { +impl Serialize for RenderType { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer, @@ -388,12 +388,12 @@ impl Serialize for IndexItemFunctionType { #[derive(Debug)] pub struct TypeWithKind { - ty: Type, + ty: RenderType, kind: TypeKind, } -impl From<(Type, TypeKind)> for TypeWithKind { - fn from(x: (Type, TypeKind)) -> TypeWithKind { +impl From<(RenderType, TypeKind)> for TypeWithKind { + fn from(x: (RenderType, TypeKind)) -> TypeWithKind { TypeWithKind { ty: x.0, kind: x.1 } } } diff --git a/src/librustdoc/html/render/cache.rs b/src/librustdoc/html/render/cache.rs index 90bbc8929c0..ed0de2b3119 100644 --- a/src/librustdoc/html/render/cache.rs +++ b/src/librustdoc/html/render/cache.rs @@ -12,7 +12,7 @@ use std::path::{Path, PathBuf}; use serde::Serialize; use super::{plain_summary_line, shorten, Impl, IndexItem, IndexItemFunctionType, ItemType}; -use super::{Generic, RenderInfo, Type, TypeWithKind}; +use super::{Generic, RenderInfo, RenderType, TypeWithKind}; /// Indicates where an external crate can be found. pub enum ExternalLocation { @@ -665,8 +665,8 @@ fn get_index_search_type(item: &clean::Item) -> Option<IndexItemFunctionType> { Some(IndexItemFunctionType { inputs, output }) } -fn get_index_type(clean_type: &clean::Type) -> Type { - let t = Type { +fn get_index_type(clean_type: &clean::Type) -> RenderType { + let t = RenderType { ty: clean_type.def_id(), idx: None, name: get_index_type_name(clean_type, true).map(|s| s.to_ascii_lowercase()), |
