feat: cleaning empty lines in config

This commit is contained in:
Ahmet Kaan GÜMÜŞ 2024-11-20 00:20:40 +03:00
parent 6be3a7f5c6
commit 2ee8c435d1
2 changed files with 8 additions and 6 deletions

View file

@ -1,8 +1,8 @@
[start_parameters] [input_parameters]
decision_variable_count = 50 decision_variable_count = 30
food_source_number = 20 food_source_number = 20
food_source_try_limit = 1000 food_source_try_limit = 60
upper_bound = 100 upper_bound = 100
lower_bound = -100 lower_bound = -100
iteration = 100 iteration = 1000
run = 30 run = 100

View file

@ -95,6 +95,7 @@ impl Input {
} }
line line
}) })
.filter(|uncommented_line| !uncommented_line.is_empty())
.for_each(|line| { .for_each(|line| {
lines.append( lines.append(
&mut line &mut line
@ -103,6 +104,7 @@ impl Input {
.collect::<Vec<String>>(), .collect::<Vec<String>>(),
) )
}); });
if lines[0].starts_with("[input_parameters]") { if lines[0].starts_with("[input_parameters]") {
for i in 1..lines.len() { for i in 1..lines.len() {
match lines[i].as_str() { match lines[i].as_str() {