From a7923fbcf3c21c1a2ab6c527d1e07d40ec6fbd58 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Wed, 17 Nov 2021 19:36:16 -0500 Subject: [PATCH] Remove another unnecessary method --- recipes/src/lib.rs | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/recipes/src/lib.rs b/recipes/src/lib.rs index 834dc3a..fdc625c 100644 --- a/recipes/src/lib.rs +++ b/recipes/src/lib.rs @@ -15,12 +15,10 @@ pub mod parse; pub mod unit; use std::collections::BTreeMap; -use std::str::FromStr; use chrono::NaiveDate; use uuid::{self, Uuid}; -use parse::*; use unit::*; #[derive(Debug, Clone, PartialEq)] @@ -220,26 +218,6 @@ impl Ingredient { self.amt.measure_type(), ); } - - pub fn parse(s: &str) -> Result { - Ok(match ingredient(abortable_parser::StrIter::new(s)) { - abortable_parser::Result::Complete(_, ing) => ing, - abortable_parser::Result::Abort(e) | abortable_parser::Result::Fail(e) => { - return Err(format!("Failed to parse as Ingredient {:?}", e)) - } - abortable_parser::Result::Incomplete(_) => { - return Err(format!("Incomplete input: {}", s)) - } - }) - } -} - -impl FromStr for Ingredient { - type Err = String; - - fn from_str(s: &str) -> Result { - Ingredient::parse(s) - } } impl std::fmt::Display for Ingredient {