@@ -493,7 +493,20 @@ impl Rocket<Build> {
493
493
///
494
494
/// ```rust,no_run
495
495
/// # #[macro_use] extern crate rocket;
496
- /// # extern crate rocket_dyn_templates;
496
+ /// # fn some_function() {}
497
+ /// # mod rocket_dyn_templates {
498
+ /// # use rocket::fairing::{Fairing, Info, Kind};
499
+ /// # #[derive(Default)]
500
+ /// # pub struct Templates;
501
+ /// # impl Fairing for Templates {
502
+ /// # fn info(&self) -> Info {
503
+ /// # Info { name: "", kind: Kind::Ignite }
504
+ /// # }
505
+ /// # }
506
+ /// # impl Templates {
507
+ /// # pub fn register_function(&mut self, _name: &str, _f: impl Fn()) {}
508
+ /// # }
509
+ /// # }
497
510
/// use rocket::Rocket;
498
511
/// use rocket::fairing::AdHoc;
499
512
/// use rocket_dyn_templates::Templates;
@@ -502,11 +515,12 @@ impl Rocket<Build> {
502
515
/// fn rocket() -> _ {
503
516
/// rocket::build()
504
517
/// .attach(Templates::default())
505
- /// .attach(AdHoc::on_ignite("Register new template function", |r| {
506
- /// r.modify_fairing(|f: &mut Templates| {
507
- /// f.register_function("some_function", some_function)
508
- /// })
509
- /// })))
518
+ /// .attach(AdHoc::on_ignite("Register new template function", |r| async move {
519
+ /// r.modify_fairings(|f: &mut Templates| {
520
+ /// f.register_function("some_function", some_function);
521
+ /// Ok::<(), ()>(())
522
+ /// }).unwrap()
523
+ /// }))
510
524
/// }
511
525
/// ```
512
526
///
0 commit comments