From c5d5e7e536d1b3d2f1ce4ce7df2c23fe5ba081b9 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Wed, 17 Nov 2021 19:14:56 -0500 Subject: [PATCH] TODO cleanup --- kitchen/src/main.rs | 1 - recipes/src/unit.rs | 15 --------------- 2 files changed, 16 deletions(-) diff --git a/kitchen/src/main.rs b/kitchen/src/main.rs index 7ffc1dc..d5a9b1d 100644 --- a/kitchen/src/main.rs +++ b/kitchen/src/main.rs @@ -56,7 +56,6 @@ fn main() { let recipe_file = matches.value_of("INPUT").unwrap(); match cli::parse_recipe(recipe_file) { Ok(r) => { - // TODO(jwall): handle our recipe dump output_recipe_info(r, matches.is_present("ingredients")); } Err(e) => { diff --git a/recipes/src/unit.rs b/recipes/src/unit.rs index 13c80b9..61336cf 100644 --- a/recipes/src/unit.rs +++ b/recipes/src/unit.rs @@ -24,11 +24,8 @@ use std::{ ops::{Add, Div, Mul, Sub}, }; -use abortable_parser::{Result, StrIter}; use num_rational::Ratio; -use crate::parse::measure; - #[derive(Copy, Clone, Debug)] /// Volume Measurements for ingredients in a recipe. pub enum VolumeMeasure { @@ -394,17 +391,6 @@ impl Measure { Weight(wm) => wm.plural(), } } - - // TODO(jwall): Remove this it's unnecessary - pub fn parse(input: &str) -> std::result::Result { - Ok(match measure(StrIter::new(input)) { - Result::Complete(_, measure) => measure, - Result::Abort(e) | Result::Fail(e) => { - return Err(format!("Failed to parse as Measure {:?}", e)) - } - Result::Incomplete(_) => return Err(format!("Incomplete input: {}", input)), - }) - } } impl Display for Measure { @@ -412,7 +398,6 @@ impl Display for Measure { match self { Volume(vm) => write!(w, "{}", vm), Count(qty) => write!(w, "{}", qty), - // TODO(jwall): Should I allow auto convert upwards for the grams to kgs? Weight(wm) => write!(w, "{}", wm), } }