From c7c98f985f61bffe700748b25e10420ecb6ef709 Mon Sep 17 00:00:00 2001 From: Mitchell M Date: Wed, 19 Jun 2024 09:39:51 -0500 Subject: [PATCH] small tweaks --- src/controls/group.rs | 6 +----- src/form_builder.rs | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/controls/group.rs b/src/controls/group.rs index fa0f2b5..f8e1919 100644 --- a/src/controls/group.rs +++ b/src/controls/group.rs @@ -11,12 +11,9 @@ impl FormBuilder { /// This creates a subsection of the form that controls can be added to /// like a normal form. pub fn group(mut self, builder: impl Fn(FormBuilder) -> FormBuilder) -> Self { - let mut group_builder = FormBuilder::new_group(self.cx); + let mut group_builder = FormBuilder::new_group(self.cx.clone()); group_builder = builder(group_builder); - // Take context back - self.cx = group_builder.cx; - for validation in group_builder.validations { self.validations.push(validation); } @@ -34,7 +31,6 @@ impl FormBuilder { }); let view = fs.group(render_data.clone()); - // TODO: add conditional rendering let validation_cb = move || { let mut success = true; diff --git a/src/form_builder.rs b/src/form_builder.rs index 8e75e4c..fbbd272 100644 --- a/src/form_builder.rs +++ b/src/form_builder.rs @@ -25,7 +25,7 @@ pub struct FormBuilder { pub(crate) validations: Vec>>, /// The list of functions that will render the form. pub(crate) render_fns: Vec>>, - /// The list of styling attributes applied on the form level + /// The list of styling attributes applied on the form level. pub(crate) styles: Vec<::StylingAttributes>, }