Skip to content

Commit

Permalink
Rename render::Type to improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Mar 3, 2020
1 parent 71b9512 commit 6ffe9f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 }
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/render/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -664,8 +664,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()),
Expand Down

0 comments on commit 6ffe9f3

Please sign in to comment.