Skip to content

Commit 883163a

Browse files
committed
revert
1 parent c1495cd commit 883163a

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fl2rust"
3-
version = "0.5.3"
3+
version = "0.5.4"
44
authors = ["Mohammed Alyousef <[email protected]>"]
55
edition = "2021"
66
description = "A fluid (fltk ui designer) file to Rust transpiler"

fl_tests/col.fl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class UserInterface {open
99
Fl_Window {} {open selected
1010
xywh {190 213 510 360} type Double resizable visible
1111
} {
12-
Fl_Box b {
12+
Fl_Button b {
1313
label button
1414
image {../fltk-rs/screenshots/calc.jpg} xywh {25 25 220 145} box BORDER_BOX shortcut 0x4006e color 87 labeltype SHADOW_LABEL labelfont 11 when 1 resizable
1515
}

src/gen.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -469,20 +469,16 @@ fn add_funcs(functions: &[Function], free: bool, named: &mut Vec<(String, String
469469
if !c.widgets.is_empty() {
470470
func += &add_widgets(None, &c.widgets, named);
471471
}
472-
if !free {
473-
func += "\tSelf {\n";
474-
} else if let Some(ret) = &c.props.return_type {
475-
writeln!(func, "\t{} {{", ret).unwrap();
476-
}
477-
if !named.is_empty() && (c.props.return_type.is_some() || !free) {
472+
func += "\tSelf {\n";
473+
if !named.is_empty() {
478474
for n in named.iter() {
479475
func += "\t ";
480476
func += &n.0;
481477
func += ",\n";
482478
}
483-
func += "\t}\n";
484479
}
485-
func += " }";
480+
func += "\t}";
481+
func += "\n }";
486482
}
487483
func
488484
}
@@ -564,4 +560,4 @@ pub fn generate(ast: &Ast) -> String {
564560
pub fn generate_with_directives_preamble(ast: &Ast) -> String {
565561
let s = generate_(ast);
566562
format!("{}\n{}\n{}", ALLOWS, HEADER, s)
567-
}
563+
}

0 commit comments

Comments
 (0)