/// Wrap a two-argument helper function into a helper object to add to the
/// handlebars registry.
Wrap a two-argument helper function into a helper object to add to the
handlebars registry.
Wrap a two - argument helper function into a helper object to add to the handlebars registry .
fn wrap_helper<F>(helper_fn: F) -> Box<dyn HelperDef + Send + Sync>
where
    F: for<'reg, 'rc> Fn(&Helper<'reg, 'rc>, &mut dyn Output) -> HelperResult
        + Send
        + Sync
        + 'static,
{
    // Create the closure that implements the HelperDef trait
    let closure = move |h: &Helper,
                        _: &Handlebars,
                        _: &Context,
                        _: &mut RenderContext,
                        out: &mut dyn Output| { helper_fn(h, out) };
    // Box and return
    return Box::new(closure);
}
fn wrap_helper < F > ( helper_fn : F ) -> Box < dyn HelperDef + Send + Sync > where F : for < ' reg , ' rc > Fn ( & Helper < ' reg , ' rc > , & mut dyn Output ) -> HelperResult + Send + Sync + ' static , { // Create the closure that implements the HelperDef trait let closure = move | h : & Helper , _ : & Handlebars , _ : & Context , _ : & mut RenderContext , out : & mut dyn Output | { helper_fn ( h , out ) } ; // Box and return return Box :: new ( closure ) ; }
Wrap a two-argument helper function into a helper object to add to the
handlebars registry.
Wrap a two - argument helper function into a helper object to add to the handlebars registry .
helper_fn
F