1
Fork 0

Remove StructType entirely and replace it with CtorKind

This commit is contained in:
Rune Tynan 2021-01-20 17:19:46 -05:00
parent 450c5eae1d
commit 3349b40d47
No known key found for this signature in database
GPG key ID: 7ECC932F8B2C731E
5 changed files with 22 additions and 44 deletions

View file

@ -5,6 +5,7 @@
use std::convert::From;
use rustc_ast::ast;
use rustc_hir::def::CtorKind;
use rustc_span::def_id::{DefId, CRATE_DEF_INDEX};
use rustc_span::Pos;
@ -220,13 +221,12 @@ impl From<clean::Union> for Struct {
}
}
impl From<clean::StructType> for StructType {
fn from(struct_type: clean::StructType) -> Self {
use clean::StructType::*;
impl From<CtorKind> for StructType {
fn from(struct_type: CtorKind) -> Self {
match struct_type {
Plain => StructType::Plain,
Tuple => StructType::Tuple,
Unit => StructType::Unit,
CtorKind::Fictive => StructType::Plain,
CtorKind::Fn => StructType::Tuple,
CtorKind::Const => StructType::Unit,
}
}
}