From 7a0748bc55c43b4dfcfe61c6c7327e8420c187f4 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Sat, 9 Nov 2024 12:27:55 +0100 Subject: [PATCH] refactor: rename functions --- src/model/onkostar_editor.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/model/onkostar_editor.rs b/src/model/onkostar_editor.rs index 0cb7835..6ccb1f8 100644 --- a/src/model/onkostar_editor.rs +++ b/src/model/onkostar_editor.rs @@ -212,7 +212,7 @@ impl OnkostarEditor { } pub fn fix(mut self) -> Self { - fn has_error1(form: &Form, error_code: &str) -> bool { + fn has_unterformular_error(form: &Form, error_code: &str) -> bool { form.check() .iter() .filter(|&check_notice| match check_notice { @@ -223,7 +223,7 @@ impl OnkostarEditor { > 0 } - fn has_error2(form: &Form, error_code: &str) -> bool { + fn has_dataform_error(form: &Form, error_code: &str) -> bool { form.check() .iter() .filter(|&check_notice| match check_notice { @@ -237,24 +237,24 @@ impl OnkostarEditor { self.editor .data_form .iter_mut() - .filter(|form| has_error2(form, "2023-0002")) + .filter(|form| has_dataform_error(form, "2023-0002")) .map(|form| form.to_unterformular()) .for_each(|form| self.editor.unterformular.push(form)); self.editor .unterformular .iter_mut() - .filter(|form| has_error1(form, "2023-0001")) + .filter(|form| has_unterformular_error(form, "2023-0001")) .map(|form| form.to_dataform()) .for_each(|form| self.editor.data_form.push(form)); self.editor .data_form - .retain(|form| !has_error2(form, "2023-0002")); + .retain(|form| !has_dataform_error(form, "2023-0002")); self.editor .unterformular - .retain(|form| !has_error1(form, "2023-0001")); + .retain(|form| !has_unterformular_error(form, "2023-0001")); // Sort forms by requirements self.editor