Merge struct fields and struct kind
This commit is contained in:
parent
30af54dede
commit
40aa09e4c9
36 changed files with 222 additions and 148 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue