Skip to content

Commit

Permalink
Merge pull request #1275 from bilelmoussaoui/bilelmoussaoui/gir
Browse files Browse the repository at this point in the history
gir: fix per emit_by_name change
  • Loading branch information
sdroege committed Nov 21, 2021
2 parents 768c48d + 6a4acae commit a69abbe
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/codegen/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,25 +131,21 @@ pub fn generate(
args.push_str(&par.name);
}

writeln!(
w,
"{}let {} = self.emit_by_name(\"{}\", &[{}]);",
tabs(indent + 1),
if trampoline.ret.typ != Default::default() {
"res"
} else {
"_"
},
analysis.signal_name,
args,
)?;

if trampoline.ret.typ != Default::default() {
writeln!(
w,
"{}res.unwrap().get().expect(\"Return Value for `{}`\")",
"{}self.emit_by_name(\"{}\", &[{}])",
tabs(indent + 1),
analysis.signal_name,
args,
)?;
} else {
writeln!(
w,
"{}self.emit_by_name::<()>(\"{}\", &[{}]);",
tabs(indent + 1),
emit_name,
analysis.signal_name,
args,
)?;
}
writeln!(w, "{}}}", tabs(indent))?;
Expand Down

0 comments on commit a69abbe

Please sign in to comment.