Removed unnecessary option return type

This commit is contained in:
2026-05-04 17:14:17 +02:00
parent 32a08d3e7f
commit 7b1d2e3d91
3 changed files with 9 additions and 8 deletions
+7 -6
View File
@@ -217,12 +217,13 @@ impl ToRust for TopLevel {
.collect::<Vec<_>>()
.join(", ");
let ret = return_type
.as_ref()
.map(|t| format!(" -> {}", t.get_rust()))
.unwrap_or_default();
cg.addln(&format!("{}fn {}({}){} {{", vis, name, params_str, ret));
cg.addln(&format!(
"{}fn {}({}) -> {} {{",
vis,
name,
params_str,
return_type.get_rust()
));
cg.indent += 1;
body.to_rust(cg);
cg.indent -= 1;