Extend 'Engines' example to illustrate its proper use.

This commit is contained in:
Jeb Rosen 2019-09-01 09:41:34 -07:00
parent 9c5d0912ec
commit 22442313a7
1 changed files with 9 additions and 3 deletions

View File

@ -36,9 +36,15 @@ pub(crate) trait Engine: Send + Sync + 'static {
/// # */ unimplemented!();
/// }
///
/// Template::custom(|engines: &mut Engines| {
/// engines.tera.register_filter("my_filter", my_filter);
/// });
/// fn main() {
/// rocket::ignite()
/// // ...
/// .attach(Template::custom(|engines: &mut Engines| {
/// engines.tera.register_filter("my_filter", my_filter);
/// }))
/// // ...
/// # ;
/// }
/// # }
/// ```
///