mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-07 21:27:06 +00:00
templater: remove now unused TemplatePropertyFn wrapper
This commit is contained in:
parent
cecae849aa
commit
0fad9c9795
1 changed files with 0 additions and 14 deletions
|
@ -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.
|
/// Adapter to extract context-less template value from property for displaying.
|
||||||
pub struct FormattablePropertyTemplate<P> {
|
pub struct FormattablePropertyTemplate<P> {
|
||||||
property: P,
|
property: P,
|
||||||
|
|
Loading…
Reference in a new issue