Skip to content

Commit

Permalink
+ simplify ref match
Browse files Browse the repository at this point in the history
  • Loading branch information
Bromeon committed Sep 15, 2024
1 parent 0cd7512 commit a562acd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions godot-codegen/src/generator/default_parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,9 @@ fn make_field_init(
match (conversion, expr) {
(Conv::ObjectArg, Some(expr)) => quote! { #name: #expr.consume_object() },
(Conv::ObjectArg, None) /*. */ => quote! { #name: #name.consume_object() },
(Conv::Reference, Some(expr)) => quote! { #name: #expr },
(Conv::Reference, None) /*. */ => quote! { #name },
(Conv::None | Conv::ReferenceWithDefault, Some(expr)) => quote! { #name: #expr },
(Conv::None | Conv::ReferenceWithDefault, None) /*. */ => quote! { #name },

// Currently no differentiation between None|Reference|ReferenceWithDefault; this may change...
(Conv::None | Conv::Reference | Conv::ReferenceWithDefault, Some(expr)) => quote! { #name: #expr },
(Conv::None | Conv::Reference | Conv::ReferenceWithDefault, None) /*. */ => quote! { #name },
}
}

0 comments on commit a562acd

Please sign in to comment.