Skip to content

Commit

Permalink
fix: err
Browse files Browse the repository at this point in the history
  • Loading branch information
fzyzcjy committed Mar 6, 2024
1 parent 9077889 commit 9af6e7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ impl LangTrait for DartLang {
fn call_constructor(
&self,
class_name: &str,
ctor_name: Option<&str>,
ctor_postfix: &str,
field_names: &[String],
var_names: &[String],
keyword_args: bool,
) -> String {
let dotted_ctor_name = ctor_name.map_or_else(|| "".to_owned(), |x| format!(".{x}"));
format!(
"{class_name}{dotted_ctor_name}({})",
"{class_name}{ctor_postfix}({})",
multizip((field_names, var_names))
.map(|(x, y)| if keyword_args {
format!("{x}: {y}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,7 @@ impl<'a> GeneralizedStructGenerator<'a> {
let ctor = match self.mode {
Struct => lang.call_constructor(
&override_struct_name.unwrap_or_else(|| self.st.name.style(lang)),
Some(dart_constructor_postfix(
&self.st.name,
&self.context.ir_pack.funcs,
)),
dart_constructor_postfix(&self.st.name, &self.context.ir_pack.funcs),
&(self.st.fields.iter())
.map(|x| x.name.style(lang))
.collect_vec(),
Expand Down

0 comments on commit 9af6e7d

Please sign in to comment.