]> saetta.ns0.it Git - rust/zakform/commitdiff
In Form::remove_field, return after item found.
authorAndrea Zagli <azagli@libero.it>
Sun, 5 Mar 2023 09:17:12 +0000 (10:17 +0100)
committerAndrea Zagli <azagli@libero.it>
Sun, 5 Mar 2023 09:17:12 +0000 (10:17 +0100)
src/form.rs

index 24a88a9acf388eb2f6aaa29dfb7db96324c0835b..a01558c7250695ee32f298f6370555508a32dd5e 100644 (file)
@@ -18,6 +18,7 @@ impl Form {
                while i < self.fields.len() {
                        if self.fields[i].get_name() == field_name {
                                self.fields.remove(i);
+                               return;
                        }
                        i += 1;
                }