1
Fork 0

Merge struct fields and struct kind

This commit is contained in:
Vadim Petrochenkov 2015-10-08 23:45:46 +03:00
parent 30af54dede
commit 40aa09e4c9
36 changed files with 222 additions and 148 deletions

View file

@ -234,9 +234,9 @@ pub struct Import {
}
pub fn struct_type_from_def(sd: &hir::VariantData) -> StructType {
if sd.kind != hir::VariantKind::Struct {
if !sd.is_struct() {
// We are in a tuple-struct
match sd.fields.len() {
match sd.fields().count() {
0 => Unit,
1 => Newtype,
_ => Tuple