templater: remove now unused TemplatePropertyFn wrapper

This commit is contained in:
Yuya Nishihara 2024-03-20 13:26:10 +09:00
parent cecae849aa
commit 0fad9c9795

View file

@ -348,20 +348,6 @@ impl<C, O: Clone> TemplateProperty<C> for Literal<O> {
}
}
/// Adapter to turn closure into property.
pub struct TemplatePropertyFn<F>(pub F);
impl<C, O, F> TemplateProperty<C> for TemplatePropertyFn<F>
where
F: Fn(&C) -> Result<O, TemplatePropertyError>,
{
type Output = O;
fn extract(&self, context: &C) -> Result<Self::Output, TemplatePropertyError> {
(self.0)(context)
}
}
/// Adapter to extract context-less template value from property for displaying.
pub struct FormattablePropertyTemplate<P> {
property: P,