Fix ingredient parsing to be less obnoxious

This commit is contained in:
Matteo Settenvini 2022-08-12 23:36:27 +02:00
parent 7025ee9e3a
commit 63860cd05a
Signed by: matteo
GPG key ID: 8576CC1AD97D42DF
2 changed files with 28 additions and 18 deletions

View file

@ -131,10 +131,7 @@ fn prepare_grocery_list(ingredients: &Vec<(Ingredient, Vec<String>)>) -> Result<
)?;
writeln!(out)?; // leave an empty line
for (ingredient, recipes) in ingredients {
writeln!(out, "- [ ] {}", ingredient)?;
for recipe in recipes {
writeln!(out, " * {}", recipe)?;
}
writeln!(out, "- [ ] {} ({})", ingredient, recipes.join(", "))?;
}
Ok(out)