Skip to content

Commit

Permalink
Fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
vkobinski committed Jun 16, 2024
1 parent 1681edd commit b5479e2
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions crates/benda/src/types/user_adt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,25 @@ impl<'py> BendType for UserAdt<'py> {

if let Some(t) = extract_type_raw(attr.clone()) {
adt_fields.push(t.to_bend().unwrap());
}

if let Some(adt) = UserAdt::new(attr, &self.book) {
} else if let Some(adt) = UserAdt::new(attr, &self.book) {
let new_adt = adt.to_bend();
adt_fields.push(new_adt.unwrap());
}

let field_name = nam.split('/').nth(0).unwrap();

let new_ctr =
self.book.adts.get(&Name::new(field_name.to_string()));

for c in new_ctr.unwrap().ctrs.iter() {
if c.1.is_empty() {
adt_fields.push(imp::Expr::Ctr {
name: c.0.clone(),
args: vec![],
kwargs: vec![],
})
} else {
let field_name = nam.split('/').nth(0).unwrap();

let new_ctr = self
.book
.adts
.get(&Name::new(field_name.to_string()));

for c in new_ctr.unwrap().ctrs.iter() {
if c.1.is_empty() {
adt_fields.push(imp::Expr::Ctr {
name: c.0.clone(),
args: vec![],
kwargs: vec![],
})
}
}
}
}
Expand Down

0 comments on commit b5479e2

Please sign in to comment.