From f01035f5f53934d2fc4775626ed6f36efa404618 Mon Sep 17 00:00:00 2001 From: Sandipsinh Rathod Date: Fri, 29 Nov 2024 13:29:26 -0500 Subject: [PATCH] drop `EvalStrict` --- src/core/mustache/eval.rs | 28 ---------------------------- src/core/mustache/mod.rs | 2 +- 2 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/core/mustache/eval.rs b/src/core/mustache/eval.rs index fe8b8416b6..6ef00742a9 100644 --- a/src/core/mustache/eval.rs +++ b/src/core/mustache/eval.rs @@ -8,13 +8,6 @@ pub trait Eval<'a> { fn eval(&'a self, mustache: &'a Mustache, in_value: &'a Self::In) -> Self::Out; } -pub trait EvalStrict<'a> { - type In; - type Out; - - fn eval_strict(&'a self, mustache: &'a Mustache, in_value: &'a Self::In) -> Self::Out; -} - pub struct PathStringEval(std::marker::PhantomData); impl PathStringEval { @@ -42,27 +35,6 @@ impl Eval<'_> for PathStringEval { } } -impl EvalStrict<'_> for PathStringEval { - type In = A; - type Out = String; - - fn eval_strict(&'_ self, mustache: &'_ Mustache, in_value: &'_ Self::In) -> Self::Out { - mustache - .segments() - .iter() - .map(|segment| match segment { - Segment::Literal(text) => text.to_string(), - Segment::Expression(parts) => in_value - .path_string(parts) - .map(|v| v.to_string()) - .unwrap_or( - Mustache::from(vec![Segment::Expression(parts.to_vec())]).to_string(), - ), - }) - .collect() - } -} - pub trait Path { fn get_path>(&self, in_value: &[S]) -> Option<&Self>; } diff --git a/src/core/mustache/mod.rs b/src/core/mustache/mod.rs index 45b34b1971..13f906c339 100644 --- a/src/core/mustache/mod.rs +++ b/src/core/mustache/mod.rs @@ -1,5 +1,5 @@ mod eval; mod model; mod parse; -pub use eval::{Eval, EvalStrict}; +pub use eval::Eval; pub use model::*;