1
Fork 0

Rollup merge of #84464 - jyn514:type-kind, r=CraftSpider

rustdoc: Get rid of `clean::TypeKind`

It does exactly the same thing as ItemType.
This commit is contained in:
Yuki Okushi 2021-04-25 01:53:15 +09:00 committed by GitHub
commit e25c5e2c25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 93 additions and 134 deletions

View file

@ -54,7 +54,7 @@ use rustc_span::symbol::{kw, sym, Symbol};
use serde::ser::SerializeSeq;
use serde::{Serialize, Serializer};
use crate::clean::{self, GetDefId, RenderedLink, SelfTy, TypeKind};
use crate::clean::{self, GetDefId, RenderedLink, SelfTy};
use crate::docfs::PathError;
use crate::error::Error;
use crate::formats::cache::Cache;
@ -182,11 +182,11 @@ impl Serialize for IndexItemFunctionType {
#[derive(Debug)]
crate struct TypeWithKind {
ty: RenderType,
kind: TypeKind,
kind: ItemType,
}
impl From<(RenderType, TypeKind)> for TypeWithKind {
fn from(x: (RenderType, TypeKind)) -> TypeWithKind {
impl From<(RenderType, ItemType)> for TypeWithKind {
fn from(x: (RenderType, ItemType)) -> TypeWithKind {
TypeWithKind { ty: x.0, kind: x.1 }
}
}
@ -196,7 +196,7 @@ impl Serialize for TypeWithKind {
where
S: Serializer,
{
(&self.ty.name, ItemType::from(self.kind)).serialize(serializer)
(&self.ty.name, self.kind).serialize(serializer)
}
}