Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Nov 14, 2024
1 parent 8b01215 commit 4cafbfc
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tasks/ast_tools/src/generators/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,20 +108,19 @@ fn typescript_struct(def: &StructDef, always_flatten_structs: &FxHashSet<TypeId>

let ident = field.ident().unwrap();
if let Some(append_after) = append_to.get(&ident.to_string()) {
let after_type = if let Some(ty) =
&append_after.markers.derive_attributes.estree.typescript_type
{
ty.clone()
} else {
let typ = append_after.typ.name();
if let TypeName::Opt(inner) = typ {
type_to_string(inner)
let after_type =
if let Some(ty) = &append_after.markers.derive_attributes.estree.typescript_type {
ty.clone()
} else {
panic!(
let typ = append_after.typ.name();
if let TypeName::Opt(inner) = typ {
type_to_string(inner)
} else {
panic!(
"expected field labeled with append_to to be Option<...>, but found {typ}"
);
}
};
}
};
if let Some(inner) = ty.strip_prefix("Array<") {
ty = format!("Array<{after_type} | {inner}");
} else {
Expand Down

0 comments on commit 4cafbfc

Please sign in to comment.