]> saetta.ns0.it Git - rust/zakform/commitdiff
Missing some ; in output code.
authorAndrea Zagli <azagli@libero.it>
Sat, 20 Jan 2024 09:04:34 +0000 (10:04 +0100)
committerAndrea Zagli <azagli@libero.it>
Sat, 20 Jan 2024 09:04:34 +0000 (10:04 +0100)
src/bin/c2rs.rs

index 1e586f9d5d92df8c8b723d28e4e2e446f282566d..9f5587c52bb5f4835adaa888f14d34049b0f1dd1 100644 (file)
@@ -160,13 +160,13 @@ fn main() {
                writeln!(output, "");
 
                match e.etype.as_str() {
-                       "zak_form_cgi_form_element_text" => { writeln!(output, r#"let mut fi = zakform::fields::FieldText::new("{}")"#, e.id); },
-                       "zak_form_cgi_form_element_text_area" => { writeln!(output, r#"let mut fi = zakform::fields::FieldTextArea::new("{}")"#, e.id); },
-                       "zak_form_cgi_form_element_radio" => { writeln!(output, r#"let mut fi = zakform::fields::FieldRadio::new("{}")"#, e.id); },
-                       "zak_form_cgi_form_element_select" => { writeln!(output, r#"let mut fi = zakform::fields::FieldSelect::new("{}")"#, e.id); },
-                       "zak_form_cgi_form_element_check" => { writeln!(output, r#"let mut fi = zakform::fields::FieldCheck::new("{}")"#, e.id); },
-                       "zak_form_cgi_form_element_submit" => { writeln!(output, r#"let mut fi = zakform::fields::FieldButton::new("{}")"#, e.id); },
-                       "zak_form_cgi_form_element_file" => { writeln!(output, r#"let mut fi = zakform::fields::FieldFile::new("{}")"#, e.id); },
+                       "zak_form_cgi_form_element_text" => { writeln!(output, r#"let mut fi = zakform::fields::FieldText::new("{}");"#, e.id); },
+                       "zak_form_cgi_form_element_text_area" => { writeln!(output, r#"let mut fi = zakform::fields::FieldTextArea::new("{}");"#, e.id); },
+                       "zak_form_cgi_form_element_radio" => { writeln!(output, r#"let mut fi = zakform::fields::FieldRadio::new("{}");"#, e.id); },
+                       "zak_form_cgi_form_element_select" => { writeln!(output, r#"let mut fi = zakform::fields::FieldSelect::new("{}");"#, e.id); },
+                       "zak_form_cgi_form_element_check" => { writeln!(output, r#"let mut fi = zakform::fields::FieldCheck::new("{}");"#, e.id); },
+                       "zak_form_cgi_form_element_submit" => { writeln!(output, r#"let mut fi = zakform::fields::FieldButton::new("{}");"#, e.id); },
+                       "zak_form_cgi_form_element_file" => { writeln!(output, r#"let mut fi = zakform::fields::FieldFile::new("{}");"#, e.id); },
                        _ => { continue; },
                };
 
@@ -195,7 +195,7 @@ fn main() {
                };
 
                if e.placeholder != "" {
-                       writeln!(output, r#"fi.set_placeholder("{}");"#, e.placeholder);
+                       writeln!(output, r#"fi.set_placeholder(&String::from("{}"));"#, e.placeholder);
                }
                if e.class != "" {
                        writeln!(output, r#"fi.set_class("{}");"#, e.class);
@@ -254,7 +254,7 @@ fn main() {
                        };
                }
 
-               writeln!(output, "f.add_field(Box::new(fi);");
+               writeln!(output, "f.add_field(Box::new(fi));");
        }
 
        writeln!(output, "");