]> git.lizzy.rs Git - rust.git/commitdiff
Rename render::Type to improve naming
authorGuillaume Gomez <guillaume1.gomez@gmail.com>
Tue, 3 Mar 2020 14:53:16 +0000 (15:53 +0100)
committerGuillaume Gomez <guillaume1.gomez@gmail.com>
Mon, 16 Mar 2020 17:30:26 +0000 (18:30 +0100)
src/librustdoc/html/render.rs
src/librustdoc/html/render/cache.rs

index d21fdeb492e190b8ee9a0e834e81cd8254065f57..9e1e11c54d0263fdb43cb1143f6f61aa620e38e3 100644 (file)
@@ -302,14 +302,14 @@ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
 
 /// 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 @@ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
 
 #[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 }
     }
 }
index 90bbc8929c03ee094f490f331041c3e99ebb861d..ed0de2b311955874864e05babb5645f9f128540d 100644 (file)
@@ -12,7 +12,7 @@
 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()),