diff options
author | Ben Bridle <bridle.benjamin@gmail.com> | 2024-04-21 14:00:06 +1200 |
---|---|---|
committer | Ben Bridle <bridle.benjamin@gmail.com> | 2024-04-21 14:00:13 +1200 |
commit | 96f5733e08af331c2192f875c096d720b084b7cc (patch) | |
tree | a61ac07a25a74a2f1f59dad5c71adb56de5312b7 /src/main.rs | |
parent | e81851e216a321d144b7a3d610e364114e533df7 (diff) | |
download | recipe-96f5733e08af331c2192f875c096d720b084b7cc.zip |
Simplify parsing logic
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index 96fac3a..0000000 --- a/src/main.rs +++ /dev/null @@ -1,22 +0,0 @@ -use recipe_parser::Recipe; - -fn main() { - let recipe = Recipe::parse( - "Combine {bulghur wheat, 1 cup} and {boiling water, 1 cup, for wheat}. Set aside for 20 minutes. Put {whole-meal flour, 2 cups}, {salt, 2 tsp}, and {yeast, 2 tbsp} in a bowl and stir together. Add {cold water, 1 cup} and {golden syrup, 1 tbsp}, immediately followed by {boiling water, 1 cup}. Stir to a smooth paste and stand for 2 to 3 minutes. Mix in the {egg, 1} and {high-grade flour, 3 cups}, adding the last cup of flour slowly (more or less than the cup may be needed to give a very thick batter, which is not quite as stiff as dough). Mix for 3 to 4 minutes. Cover and put in a warm place for 15 minutes. Stir well and pour into two 22cm greased loaf tins. Put in a warm place until the dough doubles in volume. Bake at 200°C for 35 minutes or until the loaf sounds hollow when tapped on the bottom. If loaf is browning too quickly, cover with foil.", - ); - for i in recipe.ingredients { - let unit = match i.unit { - Some(unit) => format!("{} of ", unit), - None => String::new(), - }; - let addendum = match i.addendum { - Some(addendum) => format!(" ({})", addendum), - None => String::new(), - }; - println!("- {} {}{}{}", i.quantity, unit, i.name, addendum); - } - println!(); - for paragraph in recipe.process { - println!("{}\n", paragraph); - } -} |